• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

WE: can you change decimal precision ?

Status
Not open for further replies.
Level 8
Joined
May 21, 2019
Messages
435
Hello,

The question may be dummy, but I still would like to know the answer:

In WE (GUI), reals are saved with 2 decimals (1.123456 is saved as "1.12"). Is it possible to change the number of decimals, to increase precision ? For example with 4 it would save "1.1234" instead :)

Sincerely,

Ricola3D

I'm not aware of a direct way to do this, but you could store the value as a string, and then use the substring methods to fetch the decimals for further math.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
I think that l4h thread is far above what the OP is asking about. Using a string as Cespie suggested is probably the simplest, but you don’t actually need to use substring. Just use Convert String to Real directly everywhere you need to specify additional precision. It will look like:

Time - Every (Real(“0.025”)) seconds of game time

I would suggest, however, that you not do a massive amount of such conversions at once if you need to use the number multiple times. Instead store it in a variable and reference the variable.

  • Set RealTemp = (Real(“1.23456”))
  • Unit Group - Pick every unit in...
    • Loop
      • Unit - Cause UNITA to damage Picked Unit for RealTemp points...[/realtemp]
 
Status
Not open for further replies.
Top