1.e-004. I want to get rid of these numbers.

Blitz3D Forums/Blitz3D Programming/1.e-004. I want to get rid of these numbers.

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Does anybody have a simple way of getting these small numbers back to the way they're written normally. Sorry, I can't remember the maths term for this (is it exponent?).

For example
x#=0.0001
print x

will yield a result of 1.e-004

"So what's your problem with that", you might say.

Well, I'm dealing with a .x file exporter that doesn't like numbers unless they're expressed as x.xxxxxxx. It doesn't like all this 'e-' stuff.

So if I do
VerySmallNumber#=0.00001
Writeline(file,VerySmallNumber#)
everything gets messed up.

I'm sure there must be a simple way - I'm just not seeing it. Any suggestions?

ATM, I'm thinking about multiplying by 1000, converting to a string, then hacking the decimal point back into the right position, but that seems like a VERY ugly workaround.

And don't say
If x<0.001 then x=0.001
I'm talking about lightmap UVs here which have to be between 0 and 1, so I can't afford to lose any precision.