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

Approximate numbers Help

Postby Wassaka » Thu Mar 24, 2016 2:54 am

First, Probably is a very very easy thing to do but i am very newbie... Well I am trying to approximate a decimal number to a whole number. Thanks and sorry my ignorancy :roll: :|
Wassaka
 
Posts: 85
Joined: Wed Dec 30, 2015 3:41 am

Re: Approximate numbers Help

Postby RJHollins » Thu Mar 24, 2016 3:17 am

use the ROUND primitive. You can set the number of decimal places.
RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm

Re: Approximate numbers Help

Postby Nowhk » Thu Mar 24, 2016 9:36 am

RJHollins wrote:use the ROUND primitive. You can set the number of decimal places.

Is it somethings added on 3.0.9? I can't see any ROUND primitive in my toolbox :shock:
I always do this passing the value via Ruby :?
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Re: Approximate numbers Help

Postby RJHollins » Thu Mar 24, 2016 10:39 am

no ... its been there forever.

check/search toolbox for things like 'formatting'.

tomorrow I'll look up what I have.
RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm

Re: Approximate numbers Help

Postby Nowhk » Thu Mar 24, 2016 10:42 am

RJHollins wrote:no ... its been there forever.

check/search toolbox for things like 'formatting'.

tomorrow I'll look up what I have.

I know that, but it's for string.
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Re: Approximate numbers Help

Postby nix » Thu Mar 24, 2016 10:51 am

Here is stream and green->
integers.fsm
(606 Bytes) Downloaded 827 times
User avatar
nix
 
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: Approximate numbers Help

Postby Nowhk » Thu Mar 24, 2016 10:55 am

nix wrote:Here is stream and green->
integers.fsm

Yes. But I meant: what if you have a Float prim with value 2.234523 and you want to "round" to 2 digit (i.e. 2.23)?
Such as round in Ruby.
Last edited by Nowhk on Thu Mar 24, 2016 10:55 am, edited 1 time in total.
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Re: Approximate numbers Help

Postby nix » Thu Mar 24, 2016 10:55 am

integers.png
integers.png (18.08 KiB) Viewed 16595 times


edit- Nowhk mate, this wasn't a reply to you, just showing it if it doesn't open in current FS.

I'm sure I know how to format, just a sec
User avatar
nix
 
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: Approximate numbers Help

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

format.fsm
(381 Bytes) Downloaded 893 times


Formatting command was found by Trogluddite,
hope helps, but maybe not what you want
User avatar
nix
 
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: Approximate numbers Help

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

nix wrote:
format.fsm


Formatting command was found by Trogluddite,
hope helps, but maybe not what you want

Not sure how fast is passing between float-string-float. Anyway, that's won't "round" really to the last digit, just "cut" the string.
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Next

Return to General

Who is online

Users browsing this forum: No registered users and 54 guests