> : Greater Than Operator
On this page
Summary
Compare if the left value is greater than the right value.
Syntax
Precedence
Priority level in expression evaluation (1 = highest, 10 = lowest): 6
Evaluated after: ^, *, /, %, +, -
Evaluated before: ==, !=, ??, &&, ||
Operands
| Position | Type | Description |
|---|---|---|
| Left | Comparable | First value to compare |
| Right | Comparable | Second value to compare |
Returns
Type: Boolean
true if left operand is greater than right operand, false otherwise.
Examples
Adult Verification
Data:
doc.Params["model"] = new {
age = 25
};
Output:
<div class="access-granted">
<p>Age verified: 25 years old</p>
</div>
High Value Order
Stock Availability
Data:
doc.Params["model"] = new {
quantity = 15
};
Output:
<button class="btn-primary">Add to Cart</button>
<p>15 in stock</p>
Performance Indicator
Data:
doc.Params["model"] = new {
revenue = 125000m,
target = 100000m
};
Output:
<div class="success">
<h3>Target Exceeded!</h3>
<p>Revenue: $125,000</p>
<p>Target: $100,000</p>
<p>Surplus: $25,000</p>
</div>
Temperature Warning
Notes
- Works with numbers, dates, and comparable types
- String comparison is case-sensitive and uses lexicographic ordering
- Date comparison compares chronological order
- Cannot compare incompatible types
- Commonly used with `` for conditional rendering
- Can be combined with logical operators (
&&,||) - For “greater than or equal”, use
>=operator
See Also
- Greater Than or Equal Operator
- Less Than Operator
- Less Than or Equal Operator
- #if Helper
- Equality Operator