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
Reducing floats to cents to display
10 posts
• Page 1 of 1
Reducing floats to cents to display
I want to reduce the output display of knob values.
I tried with string extract but to works also with negative values i have to use logic.
Is possibile to do such things with string format primitive.
Since i want values like 0,00 and -0,00
Any help?
I tried with string extract but to works also with negative values i have to use logic.
Is possibile to do such things with string format primitive.
Since i want values like 0,00 and -0,00
Any help?
Need my support for app development, website or custom scripts?
PM me if you are interested.
Experienced Java, J2EE, PHP, Javascript, Angular, Cloud Solutions developer.
PM me if you are interested.
Experienced Java, J2EE, PHP, Javascript, Angular, Cloud Solutions developer.
-
CoreStylerz - Posts: 327
- Joined: Sun Jan 22, 2012 2:19 am
- Location: italy
Re: Reducing floats to cents to display
This is implemented in float label in synthmaker. If you have it copy it from there...
the specification string looks something like this: number for example 5.468464
%.2f - rounds number to two decimal places - example: "5.47"
%8.2f - displays 8 chars (padded with spaces) with two decimal places - example: " 5.47" (notice the 4 spaces before the 5... decimal dot is consider a char too)
%08.2f - displays 8 chars (padded with zeroes) with two decimal places - example: "00005.47"
the specification string looks something like this: number for example 5.468464
%.2f - rounds number to two decimal places - example: "5.47"
%8.2f - displays 8 chars (padded with spaces) with two decimal places - example: " 5.47" (notice the 4 spaces before the 5... decimal dot is consider a char too)
%08.2f - displays 8 chars (padded with zeroes) with two decimal places - example: "00005.47"
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: Reducing floats to cents to display
Ty, i've downloaded back synthmaker.
Need my support for app development, website or custom scripts?
PM me if you are interested.
Experienced Java, J2EE, PHP, Javascript, Angular, Cloud Solutions developer.
PM me if you are interested.
Experienced Java, J2EE, PHP, Javascript, Angular, Cloud Solutions developer.
-
CoreStylerz - Posts: 327
- Joined: Sun Jan 22, 2012 2:19 am
- Location: italy
Re: Reducing floats to cents to display
...and you use format string primitive for that (or ruby), connected to label via string connector. Trog wrote here sometime ago how to format values in ruby boxes (format defs can be provided from outside). Search the forum here or via google (since searching isn't/wasn't working correctly) - keywords like format string array.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: Reducing floats to cents to display
With ruby should be easy, i've use the old module it works good.
Need my support for app development, website or custom scripts?
PM me if you are interested.
Experienced Java, J2EE, PHP, Javascript, Angular, Cloud Solutions developer.
PM me if you are interested.
Experienced Java, J2EE, PHP, Javascript, Angular, Cloud Solutions developer.
-
CoreStylerz - Posts: 327
- Joined: Sun Jan 22, 2012 2:19 am
- Location: italy
Re: Reducing floats to cents to display
its about the same in ruby..
- Code: Select all
val_string = "%0.2f"%@value.to_s
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
Re: Reducing floats to cents to display
Ty nubeat,
The primite works but seems to be buggy and unstable. It's stable but if i put some wrong tags it crashes flowstone...
The primite works but seems to be buggy and unstable. It's stable but if i put some wrong tags it crashes flowstone...
Need my support for app development, website or custom scripts?
PM me if you are interested.
Experienced Java, J2EE, PHP, Javascript, Angular, Cloud Solutions developer.
PM me if you are interested.
Experienced Java, J2EE, PHP, Javascript, Angular, Cloud Solutions developer.
-
CoreStylerz - Posts: 327
- Joined: Sun Jan 22, 2012 2:19 am
- Location: italy
Re: Reducing floats to cents to display
1) Put right tags into string primitive.
2) Connect the string primitive to format prim.
3) Make a module and add to the toolbox.
Usually you will use always the same stuff, maybe different numbers.
Format prim was always crashing (also synthmaker) when connected to bad tags. But if using correct tags - it works fine.
2) Connect the string primitive to format prim.
3) Make a module and add to the toolbox.
Usually you will use always the same stuff, maybe different numbers.
Format prim was always crashing (also synthmaker) when connected to bad tags. But if using correct tags - it works fine.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: Reducing floats to cents to display
tester wrote:1) Put right tags into string primitive.
2) Connect the string primitive to format prim.
3) Make a module and add to the toolbox.
Usually you will use always the same stuff, maybe different numbers.
Format prim was always crashing (also synthmaker) when connected to bad tags. But if using correct tags - it works fine.
thanks
Need my support for app development, website or custom scripts?
PM me if you are interested.
Experienced Java, J2EE, PHP, Javascript, Angular, Cloud Solutions developer.
PM me if you are interested.
Experienced Java, J2EE, PHP, Javascript, Angular, Cloud Solutions developer.
-
CoreStylerz - Posts: 327
- Joined: Sun Jan 22, 2012 2:19 am
- Location: italy
Re: Reducing floats to cents to display
Would "round" help here...
http://ruby-doc.org/core-2.1.2/Float.html
- Code: Select all
1.234567.round(2) #=> 1.23
1.234567.round(3) #=> 1.235
1.234567.round(4) #=> 1.2346
1.234567.round(5) #=> 1.23457
http://ruby-doc.org/core-2.1.2/Float.html
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
10 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 75 guests