Rounding Behaviour has a bug, or division by 1000x does.
-
I'm doing x1000
Round.
Divide by 1000
About every 20 of these, one pops out with something like:
33.333000000000000001
or
33.333999999999999999
-
@Deeeds yep...that happened to me when I made the weather app. I had to work around.
-
@Deeeds I'm guessing it's a floating point rounding error. You could get around this by looping through the digits and rounding using trim text at he nth digit after the decimal point, but would be nice if this wasn't needed.
-
@Jack8680 said in Rounding Behaviour has a bug, or division by 1000x does.:
@Deeeds I'm guessing it's a floating point rounding error. You could get around this by looping through the digits and rounding using trim text at he nth digit after the decimal point, but would be nice if this wasn't needed.
This is the case. Its a floating point issue. You should only be rounding your final calculated behaviour. You want to avoid rounding before your multiplies or divides.
-
@Hamed what's the most efficient way to get a time in 3 decimal places, often, like this: 88.888
-
@Hamed so then there is no way to round to a decimal?
-
Right now, unfortunately, is @Jack8680 way of doing it. I'll add number of decimal places to Round number behaviour.
-
@Hamed that would be great! Thanks
-
@Hamed Cheers. I was afraid you'd say that.
btw, if a label gets content that's longer and deeper than it was expecting and doesn't fit the text box region, and this value is getting updated a lot, it creates a bit of a slowdown each time it's trying to fit the text.
-
When updating a TTF Label, its very slow process because it destroys the label and re-creates it by turning the text into an image, then presenting it to the screen. Where as updating a BM Font label is fast because its not recreating the image.
-
@Hamed Oh, I thought from the aliasing on scaling small to large that you were rendering ttf into bitmaps in the background, long before presentation, as part of the build, and this was why they need to be loaded into the project.
-
No, you need to import it into the project for when sharing/exporting the project with the ttf font, it will work for users that don't have the font.
-
@Hamed Do you know Bogdan?
-
@Deeeds I do not