Skip to main content Link Search Menu Expand Document (external link)

> : 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


  <div class="access-granted">
    <p>Age verified:  years old</p>
  </div>

  <div class="access-denied">
    <p>Must be 18 or older</p>
  </div>

Data:

doc.Params["model"] = new {
    age = 25
};

Output:

<div class="access-granted">
  <p>Age verified: 25 years old</p>
</div>

High Value Order


  <div class="vip-order">
    <strong>High-Value Order</strong>
    <p>Expedited processing approved</p>
  </div>

Stock Availability


  <button class="btn-primary">Add to Cart</button>
  <p> in stock</p>

  <button class="btn-disabled" disabled>Out of Stock</button>

Data:

doc.Params["model"] = new {
    quantity = 15
};

Output:

<button class="btn-primary">Add to Cart</button>
<p>15 in stock</p>

Performance Indicator


  <div class="success">
    <h3>Target Exceeded!</h3>
    <p>Revenue: $</p>
    <p>Target: $</p>
    <p>Surplus: $</p>
  </div>

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


  <span class="danger">⚠ High Temperature Alert: °F</span>

  <span class="warning">Warm: °F</span>

  <span class="normal">°F</span>


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