Creative+ how can you convert variables from decimal fractions to normal numbers? (FIXED)

Ezolile

Member
Joined
May 19, 2023
Messages
44
Try with Set variable > Numbers > Round number. In there you can choose how many decimal points will be after whole number. And also if you set up variable correctly it should not have any decimal spaces.
 

marti

New member
Joined
May 19, 2023
Messages
14
Try with Set variable > Numbers > Round number. In there you can choose how many decimal points will be after whole number. And also if you set up variable correctly it should not have any decimal spaces.
tried, doesn't work, the .0 is still there
nvm i found the problem that was causing that
 
Last edited:

deefer

Active member
Joined
May 22, 2023
Messages
453
oh my lord stop trying this goofy thing is the server-side doesnt know how rounding works the devs dont know what the diff between a float type or a double
 

Aalus

Big Bandar
Joined
May 20, 2023
Messages
447
oh my lord stop trying this goofy thing is the server-side doesnt know how rounding works the devs dont know what the diff between a float type or a double
You don't know too
 

Hayden

Member
Joined
May 19, 2023
Messages
34
Hello @marti

I have seen players have this kind of issue, and I myself do the simplest thing. First, we are unable to get rid of the .0 by rounding, as all that does is run a check to see what should be incremented, so what we have to do is set a DISPLAY value, or front end, which replaces the .0 in text, because number variables can't be text, it would have to be *-display, and use that in messages


YAML:
function simplify(v: variable):
    set {_Simplifyvar} to v
    set {array-simplifyvar::*} to {_Simplifyvar} split at "v"
    set {simpvalue} to {array-simplifyvar::1}

This code above is having us get the first element of the array we converted the number into, and since simpvalue is a different variable, we can use that in text.
This is the basic idea of decimal removal
 

Hayden

Member
Joined
May 19, 2023
Messages
34
Also numerics -> text should fix the problem, as the number to text algorithm has a built in float 0, but if you directly set it to a text it shouldn't run that
 

marti

New member
Joined
May 19, 2023
Messages
14
oh my lord stop trying this goofy thing is the server-side doesnt know how rounding works the devs dont know what the diff between a float type or a double
did u even read the title
 
Top