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.
InputArgumentsReturns
Sourcefloat64float64boolBasicSource
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
trueBelowSource
Returns false when the value does not exceed the operand.
Given
{"score": 50}Template
{{ score | gt:70 }}Result
falseFloatSource
Compares fractional values numerically, so 4.5 exceeds 4.
Given
{"rating": 4.5}Template
{{ rating | gt:4 }}Result
trueNegativeSource
Shows a negative value is not greater than zero.
Given
{"balance": -5}Template
{{ balance | gt:0 }}Result
false