Jump to content

Formatting Numbers


nscnick

Recommended Posts

HiI am using the result of a js calculation in an html table, and would like to be able to force decimal places to show currencies. Is there a way of doing this? I can't find any function references or formatting information for html, or would I need to to use something else?Many thanks for any help received.

Link to comment
Share on other sites

Sorry for that, I am doing to many typos these days :)

Link to comment
Share on other sites

:) Nice style of writing I must say :)
Link to comment
Share on other sites

Thanks for the pointers. I had seen this but it doesn't force decimal places, (much as an Excel cell can). I think I can do it in VB but don't know if it is possible to spawn out to another file within js.I have tried using two decimal places in default figures but if an integer is put in (such as ordering a qty of an item) then the result ends up as an integer or one decimal place.The problem is that I want to display the result of a currency calculation, which needs the minor units.

Link to comment
Share on other sites

Did you see pulpfiction's posting in the HTML forum regarding the toFixed method?http://w3schools.invisionzone.com/index.ph...ost&p=63339See also:http://www.pageresource.com/jscript/j_a_03.htm
Yes thanks, it was me. I wasn't sure if there was an html solution as an alternative. However I did find out that the method turns a number into a string!Problem now solved, thanks for all help.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...