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) 

here live example, here documentation.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -