diff options
Diffstat (limited to 'stdlib/source/format')
-rw-r--r-- | stdlib/source/format/lux/data/text.lux | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/stdlib/source/format/lux/data/text.lux b/stdlib/source/format/lux/data/text.lux index d998310ae..e4adae6f7 100644 --- a/stdlib/source/format/lux/data/text.lux +++ b/stdlib/source/format/lux/data/text.lux @@ -87,6 +87,26 @@ [json json.JSON (of json.codec encoded)] ) +(with_template [<suffix> <name>] + [(def .public <name> + (Format Frac) + (|>> ((template.symbol [frac._] [<name>])) + frac.int + ..int + (text.suffix <suffix>)))] + + ["%" percentage] + + ... https://en.wikipedia.org/wiki/Degree_symbol + ["°" degree] + + ... https://en.wikipedia.org/wiki/Per_mille + ["‰" permille] + + ... https://en.wikipedia.org/wiki/Basis_point + ["‱" permyriad] + ) + (with_template [<type> <format>,<codec>] [(`` (with_template [<format> <codec>] [(def .public <format> |