Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Approximate numbers Help

For general discussion related FlowStone

Re: Approximate numbers Help

Postby nix » Thu Mar 24, 2016 11:21 am

hmm, maybe some multiplication and division trick using int?

But Ruby is prolly the way
User avatar
nix
 
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: Approximate numbers Help

Postby Nowhk » Thu Mar 24, 2016 11:23 am

nix wrote:But Ruby is prolly the way

Yes :) Maybe in the future there will be a dedicated prim ;) Thanks for the hints anyway!
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Re: Approximate numbers Help

Postby Nubeat7 » Thu Mar 24, 2016 12:51 pm

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 801 times
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: Approximate numbers Help

Postby Nowhk » Thu Mar 24, 2016 2:17 pm

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 809 times

(for you example, 57.783 and not 57.784). Thanks for the tip dude! Another learned thing!
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 59 guests