View Single Post
Old 08-14-2019, 09:42 AM   #1
Human being with feelings
DarkStar's Avatar
Join Date: May 2006
Location: Surrey, UK
Posts: 18,054
Default Q: Get signed decimal part from number?

Given, for example, the numbers (which are themselves the result of a calculation)
-9.12, -7.45, -0.52, 0.52, 7.45, 9.12

In JS FX or lua, what is the best way to get these formatted results from them?
-12, -45, -52, +52, +45 and +12

I've tried various combos of %, floor() and ceil(), but no luck so far.

Also, do those numbers after the decimal point have a mathematical name?
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is online now   Reply With Quote