Prev Previous Post   Next Post Next
Old 08-14-2019, 09:42 AM   #1
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,677
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 offline   Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:05 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.