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
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Mar 26, 2007 8:24 pm   

Inquiring minds need to know the solution...
 
Here's a sample output.

Code:

Mob Deaths       :         979,675       361,901,151


Now I need to know how many Mob Deaths will reach the next million (in this case, it would be 362,000,000). But then after that would be 363,000,000. I know I could put a variable in for what the next million would be and use a math function that way, but I'd rather do it through zMUD if it is capable of doing so. Anyone have a solution? Or am I just stuck with #var nextmillion 362000000? Thanks.

Charneus
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Mar 26, 2007 9:03 pm   
 
Using a plain divide will always round down, so you can just do something like this:

#trig {Mob Deaths%s:%s%n%s(%n)} {#var DeathsToNext %eval((((%1/1000000)+1)*1000000)-%1)}

There're probably tidier ways to do it, but it's a starting point.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Mon Mar 26, 2007 10:07 pm   
 
#trig {Mob Deaths%s:%s%n%s(%n)} {#var DeathsToNext %eval(1000000-%rightback(%1,6))}
_________________
The only good questions are the ones we have never answered before.
Search the Forums
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