gt

Reports whether the value is greater than the given number, comparing both as numbers so 5 and 5.0 rank the same.

A non-numeric operand is an error, and nil counts as zero.

InputArgumentsReturnsfloat64float64bool
Source
BasicSource

Reports whether the value is greater than the operand, comparing numerically across the int and float kinds.

Given

{"score": 82}

Template

{{ score | gt:70 }}

Result

true
BelowSource

Returns false when the value does not exceed the operand.

Given

{"score": 50}

Template

{{ score | gt:70 }}

Result

false
FloatSource

Compares fractional values numerically, so 4.5 exceeds 4.

Given

{"rating": 4.5}

Template

{{ rating | gt:4 }}

Result

true
NegativeSource

Shows a negative value is not greater than zero.

Given

{"balance": -5}

Template

{{ balance | gt:0 }}

Result

false