Approximate numbers Help

For general discussion related FlowStone
User avatar
nix
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: Approximate numbers Help

Post by nix »

hmm, maybe some multiplication and division trick using int?

But Ruby is prolly the way
Nowhk
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Re: Approximate numbers Help

Post by Nowhk »

nix wrote:But Ruby is prolly the way

Yes :) Maybe in the future there will be a dedicated prim ;) Thanks for the hints anyway!
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: Approximate numbers Help

Post by Nubeat7 »

Nowhk wrote:Anyway, that's won't "round" really to the last digit, just "cut" the string.


thats not true, the format string does correct rounding...

this has been discussed several times here on the forum, here is one with different solutions:
viewtopic.php?f=3&t=3666&start=30
Attachments
Float to Decimal Place Converter.fsm
(399 Bytes) Downloaded 849 times
Nowhk
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Re: Approximate numbers Help

Post by Nowhk »

Nubeat7 wrote:
Nowhk wrote:Anyway, that's won't "round" really to the last digit, just "cut" the string.


thats not true, the format string does correct rounding...

this has been discussed several times here on the forum, here is one with different solutions:
viewtopic.php?f=3&t=3666&start=30

Oh nice, your example seems to works better. In fact here the rounding is not the expected value:

format_2.fsm
(506 Bytes) Downloaded 855 times

(for you example, 57.783 and not 57.784). Thanks for the tip dude! Another learned thing!
Post Reply