decimal - Display trailing zero for price in jquery -


hopefully can this. looking add final 0 decimal part of price in price calculator written.

the calculator starts user selecting standard "sign up" fee of €25.50 , selecting other packages increase price.

at moment, standard price displays €25.5.

costs = jquery('.cost-container').text(); total = number(costs) + (25.50).tofixed(2); 

i got code looking @ following similar query: how add trailing 0 price jquery

currently, if enter 25.511 value, result displays 25.51, shows code sort of working, issue when second decimal place 0 not display.

can spot wrong?

cheers

damien

try

costs = jquery('.cost-container').text(); total = ( number(costs) + 25.50 ).tofixed(2); 

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 -