javascript - Ensure fixed number of decimal points when using Kendo formatting -
i have played around kendo formatting. using kendo.format
, kendo.tostring()
i fix number of decimal points.
kendo.format("{0:#.#%}",22)
works well, doesn't include trailing 0 whole numbers. ex: doesn't give me 22.0%.
kendo.tostring(22,"p1")
can used ensure decimal point, adds undesirable space between number , percentage sign.(e.g.22 %
).
is there way ensure trailing 0 in formatted value (with no space before percentage sign)? or have add code remove space manually?
i can remove using simple .replace(" ", "")
, curious if there built in way control it.
you can use zeros instad of sharp symbols. ensure there digit rendered if not needed.
e.g.
kendo.format("{0:0.0%}",0.22)
Comments
Post a Comment