Converting from Scientific notation to set precision
foodgod
Posts: 13
Hello! I has hoping someone could tell me the best way of converting a number from scientific notation to set precision. I'm reading voltage values in from an A\D converter using the floatMath.spin object to convert the value to floating point. I'm trying to set the output format to a set precision of 4 decimal places but having very little luck doing so. At this time the output I'm observing in the serial terminal window is as follows:
Current pH reading in decimals: 4.484155e-43
I would like to display the value 4.4842 since I'll eventually be dealing with millivolts. I'd greatly appreciate it if someone could point me in the right direction. Thank you!
Current pH reading in decimals: 4.484155e-43
I would like to display the value 4.4842 since I'll eventually be dealing with millivolts. I'd greatly appreciate it if someone could point me in the right direction. Thank you!
Comments
Post Edited (Mike Green) : 1/20/2009 5:25:48 AM GMT
repeat 8
value <<= 1
outa[noparse][[/noparse]13_clockPin]~~
outa[noparse][[/noparse]13_clockPin]~
value += ina[noparse][[/noparse]12]
value := fMath.FFloat(value)
Debug.dec(value)
The value output I observe is anything but a floating point number. Any suggestions? Thanks!
For example, if x=12345
and you call it like this
text.dec(x,2,10)
It will print
123.45 and will clear 10 spaces total for printing in the same line.