• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

math functions in WE

Status
Not open for further replies.
Level 17
Joined
Mar 21, 2011
Messages
1,597
hi,
is there a way to get rid of some decimal places of a number? for example, i have a floating text that counts down from 3 to 0 in 0.2 steps. now it shows numbers like:
3.000
2.800
2.600
...
0.200
0.000

i want to get rid of the last 2 decimal places:
3.0
2.8
2.6
...
0.2
0.0

is there a way to do that?

thanks
 

LeP

LeP

Level 13
Joined
Feb 13, 2008
Messages
539
There is also native R2SW takes real r, integer width, integer precision returns string where precision is the argument you're looking for.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
  • Game - Display to (All players) the text: (String(1.23, 1, 2))
It is the next thing after convert real to string.Name is convert real to formatted string.
 
Status
Not open for further replies.
Top