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
14 posts
• Page 1 of 2 • 1, 2
Approximate numbers Help
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
- Wassaka
- Posts: 85
- Joined: Wed Dec 30, 2015 3:41 am
Re: Approximate numbers Help
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
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
I always do this passing the value via Ruby
- Nowhk
- Posts: 275
- Joined: Mon Oct 27, 2014 6:45 pm
Re: Approximate numbers Help
no ... its been there forever.
check/search toolbox for things like 'formatting'.
tomorrow I'll look up what I have.
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
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
Here is stream and green->
-
nix - Posts: 817
- Joined: Tue Jul 13, 2010 10:51 am
Re: Approximate numbers Help
nix wrote:Here is stream and green->
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
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
-
nix - Posts: 817
- Joined: Tue Jul 13, 2010 10:51 am
Re: Approximate numbers Help
Formatting command was found by Trogluddite,
hope helps, but maybe not what you want
-
nix - Posts: 817
- Joined: Tue Jul 13, 2010 10:51 am
Re: Approximate numbers Help
nix wrote:
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
14 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 61 guests