Debian Codegraph @

docs/content/en/functions/compare/Ge.md

raw
1 ---
2 title: compare.Ge
3 description: Reports whether the first argument is greater than or equal to all of the subsequent arguments.
4 categories: []
5 keywords: []
6 params:
7 functions_and_methods:
8 aliases: [ge]
9 returnType: bool
10 signatures: ['compare.Ge ARG1 ARG2 [ARG...]']
11 aliases: [/functions/ge]
12 ---
13
14 ## Usage
15
16 The `compare.Ge` function reports whether the first argument is greater than or equal to all of the subsequent arguments. Numbers are compared by value, regardless of type. You can also use this function to compare strings, boolean values, dates, and other comparable data types.
17
18 ## Examples
19
20 ```go-html-template
21 {{ compare.Ge 1 1 }} → true
22 {{ compare.Ge 1 2 }} → false
23 {{ compare.Ge 2 1 }} → true
24
25 {{ compare.Ge 1 1 1 }} → true
26 {{ compare.Ge 1 1 2 }} → false
27 {{ compare.Ge 1 2 1 }} → false
28 {{ compare.Ge 1 2 2 }} → false
29
30 {{ compare.Ge 2 1 1 }} → true
31 {{ compare.Ge 2 1 2 }} → true
32 {{ compare.Ge 2 2 1 }} → true
33 ```
34
35 Comparing numbers of different types:
36
37 ```go-html-template
38 {{ compare.Ge 1 1.0 }} → true
39 ```
40
41 Comparing other data types:
42
43 ```go-html-template
44 {{ compare.Ge "ab" "a" }} → true
45 {{ compare.Ge time.Now (time.AsTime "1964-12-30") }} → true
46 {{ compare.Ge true false }} → true
47 ```