Commit f4790068 authored by adrtel's avatar adrtel

- Added im_numeric for number formatting,

  accepting an empty string.
parent 4f67cd35
......@@ -1320,3 +1320,27 @@ ad_proc im_unicode2html {s} {
}
set res
}
ad_proc -public im_numeric {
num
{fmt {}}
{locale ""}
} {
Project-Open version of lc_numeric, returning "" in case of an
empty string input, instead of returning a hard error.
Given a number and a locale return a formatted version of the number
for that locale.
@param num Number in canonical form
@param fmt Format string used by the tcl format
command (should be restricted to the form "%.Nf" if present).
@param locale Locale
@return Localized form of the number
} {
if {$num eq ""} { return "" }
return [lc_numeric $num $fmt $locale]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment