float to fixed length decimal

Hints, tips and discussion about graphics and user interface elements

Moderators: electrogear, exonerate

Postby BasherT on Mon Mar 24, 2008 5:25 pm

This is really useful Oddson.

I have noticed however that if you have the + checked and you feed the module a value of zero the output is "+0". Not sure what to do about that as I can't get my head round this formatting stuff at all. Any ideas?
If I ever die of a heart attack, I hope it will be from playing my stereo too loud. ~Anonymous

Idrisoft.org
User avatar
BasherT
essemist
 
Posts: 178
Joined: Mon Oct 30, 2006 9:58 pm
Location: London, UK

Postby BasherT on Fri Mar 28, 2008 8:19 am

After hours trying to get to grips with the intricacies of the format codes, I came up with a solution to this by using a simply switch to change the format to one that does not show the sign when the value equals zero!

Image
If I ever die of a heart attack, I hope it will be from playing my stereo too loud. ~Anonymous

Idrisoft.org
User avatar
BasherT
essemist
 
Posts: 178
Joined: Mon Oct 30, 2006 9:58 pm
Location: London, UK

Postby infuzion on Fri Mar 28, 2008 2:56 pm

BasherT wrote:I have noticed however that if you have the + checked and you feed the module a value of zero the output is "+0". Not sure what to do about that as I can't get my head round this formatting stuff at all. Any ideas?
There is a difference between +0 & -0. But for what I used it for, I didn't like it. So I think I connected the output to either a Float or String primitive to get rid of it... I forget, maybe both?
Need help? First search the forum & WiKi, then post in the help forum with a clear topic, request, & OSM. Then please WiKi the correct solution. If you want my personal assistance, I charge by the hour or for an exchange of services.
infuzion
smstar
smstar
 
Posts: 6163
Joined: Wed May 04, 2005 8:02 pm
Location: Earth, USA, CO, Denver

Previous

Return to Graphics

Who is online

Users browsing this forum: No registered users and 2 guests