Formatted Float ????
Brian Riley
Posts: 626
Has anybody got any code to control the string display of a float for fixed length display of data? I have tried all sorts of search strings in OBEX and the forum and the only mention at all was a sour grapes response to Peter Verkaik's sprintf/sscanf object because it did NOT handle float.
cheers ... BBR
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont
The Shoppe at Wulfden
www.wulfden.org/TheShoppe/
cheers ... BBR
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont
The Shoppe at Wulfden
www.wulfden.org/TheShoppe/
Comments
http://obex.parallax.com/objects/20/
where the decimal point goes and the signs of the numbers, otherwise to me its the same as integer math. What is non-fixed
float... arbitrary precision?
D'uh .... I already have that. Its the updated one where FloatToFormat was added. OK, I am back on track.
I had found that manipulating precision and commenting out the 'trim trailing zeros' code let me have some control, but this is a lot cleaner.
The FloatToFormat is limited to nine places, but that is more than adequate for the data I need to display. I did find a comment by someone who wanted to display GPS data (long/lat) in degrees and decimal degrees to 6 decimal places and would need more than 9 which should be a simple mod.
Thanks ... cheers ... BBR
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont
The Shoppe at Wulfden
www.wulfden.org/TheShoppe/