Hello, I convert float from slider to integer for display it as text, but got a problem. “Step size” set to 0.1, “mouse uses step” enabled, when I move slider to right I get 0 10 20 30 40 50 60 70 80 90 100, but when I move slider to lift, I get 100 90 79 69 59 49 39 29 19 9 0. How fix it?
I believe truncate always rounds down,. It’s just the way C++ does math. I think there’s a function called Ceil that rounds it up.
If that won’t work. You can get the current value and check if the new value is greater or less then the original value and plug that in a branch, have one side add 1 (unless the value is 0 or100) and the other side stay the same
And to get the old value,. Make a float called oldvalue and at the end After you set the sound volume, drag the volume pin all the way in the end into a set old value node
Hello, I add “+0.1” after “x100” and integer show 0 10 20 30 40 50 60 70 80 90 100 90 80 70 60 50 40 30 20 10 0. But step size is 0,1 and mouse uses spteps, is 9, …,79 a bug?
its not a bug, i think thats just how C++ does math, when you convert an integer to a float i think it always rounds down
But float have 0 0,1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9 1,0 0,9 0,8 0,7 0,6 0,5 0,4 0,3 0,2 0,1 0,0 value with that settings. From where comes 79, …, 9 ?
idk but just do something like this
if (NUMBER % 10 != 0) { number ++}
but you know instead of an if statement use a branch
Its a bug Unreal Engine Issues and Bug Tracker (UE-92452) , not critical bug, as I say before, just add +0.1 after *100 and this fix it.