mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
13 lines
398 B
HTML
13 lines
398 B
HTML
{{- /* How to use */ -}}
|
|
{{- /* partial "function/format-number" (dict "PRECISION" 2 "NUMBER" 5201314 */ -}}
|
|
{{- $number := .NUMBER -}}
|
|
{{- $precision := .PRECISION | default 1 -}}
|
|
{{- with $number -}}
|
|
{{- if ge . 1000 -}}
|
|
{{- $number = printf "%vk" (lang.FormatNumberCustom $precision (div . 1000.0) "- .") -}}
|
|
{{ printf "%v" $number }}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- return $number -}}
|