You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
639 B
20 lines
639 B
{{/* |
|
NumberFormatter |
|
|
|
This partial exchanges the characters for thousends and decimals for the give integer, |
|
used in Germany. |
|
Use this for intergers and floats instead of Hugo's lang.NumFmt and float which are |
|
not language specific. |
|
|
|
Example |
|
{{ partial "func/NumberFormatter.html" ( dict "number" 123456789.1234 "precision" 1 }} |
|
will return 123.456.789,1 |
|
|
|
@return String with integer |
|
|
|
*/}} |
|
{{ $ret := strings.Replace ( lang.NumFmt .precision .number "- . ," ) "," "t" }} |
|
{{ $ret = strings.Replace $ret "." "d" }} |
|
{{ $ret = strings.Replace $ret "d" "," }} |
|
{{ strings.Replace $ret "t" "." }} |
|
|
|
|