Welcome to WebmasterWorld Guest from 18.104.22.168 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Become a Pro Member
Engineering Output Notation neil laurance
Is there a simple way of getting Engineering notation using JScript or CSS?
I know you can use number.toExponential(3) to show numbers in exponential format, but engineering is slightly different:
Exp format: 1.234e+4 Eng format: 12.345e+3 (ie the exponent is divisible by 3)
Welcome to WebmasterWorld, Neil
That's quite a first question!
You might want to download and search one of these documents. What you need might just be tucked away in a corner somewhere.
I also looked at the EcmaScript spec and didn't see one. I think you could write your own function that uses toExponential, then parses the string and fixes it up into engineering format.
Welcome to WMW.
Thanks for all the advice. Will try creating my own function and adding to Number.prototype methods...