Re: floats
- Posted by Hayden McKay <hmck1 at dodo.com.au> Apr 13, 2005
- 484 views
Thanks Matt this was the type of easy/quick solution i was looking for Matt Lewis wrote: > > Hayden McKay wrote: > > > > I don't know if the last post made it so here's my question again > > > > I was wondering if there was an easy way to seperate the exponent from a > > fractal of a float32 > > > > eg: atom float32 float32=12345.54321 > > > > I need to make two words [12345][54321] respectively > > > > The absolute easiest is probably to run the number through sprintf. > Something like this (untested): > }}} <eucode> > atom float32 float32 = 12345.54321 > sequence float_text, words > > float_text = sprintf( "%0.5f", float32 ) > words = { float_text[1..$-6], float_text[$-4..$] } > </eucode> {{{ > > Matt Lewis >