Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
m_orb
Beginner


Joined: 13 Jan 2003
Posts: 28

PostPosted: Mon Jul 07, 2003 10:02 am   

floating point operations
 
In my country we have "," as a decimal symbol in place of "." and I write for example 2,8 instead of 2.8 in all programs.
Unfortunately this makes impossible using floating point numbers/operations in zMUD...
I know I could change the symbol to "." in Windows->Regional Settings but this is not a good idea - some other programs would stop working.
Any suggestions how to go round this problem from inside of zMUD?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Jul 07, 2003 11:56 pm   
 
You'll need to build yourself a workaround until Zugg gets around to regionalizing such things (this came up a while back in the beta forums, I believe, but I forgot how he answered). Basically, what you'll want to do is make a function that simply replaces any instance of the comma with a period. If you want to see your numbers in the local format after you do your math, a sister function that replaces the period with the comma should be created:

#function Reg2Dec {%replace(%1,",",".")}
#function Dec2Reg {%replace(%1,".",",")}

To use it, do something like this:

@Dec2Reg(@Reg2Dec("3,4") * @Reg2Dec("0,5")})
Reply with quote
m_orb
Beginner


Joined: 13 Jan 2003
Posts: 28

PostPosted: Tue Jul 08, 2003 8:28 am   
 
Thanks alot MattLofton for the below workaround and information.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net