Convert Int to a decimal number
Moderator: Benj
-
- Flowcode v5 User
- Posts: 25
- Joined: Sun Feb 01, 2009 5:32 pm
- Location: Albox, Almeria, Spain.
- Has thanked: 4 times
- Contact:
Convert Int to a decimal number
Can someone help with the attached. I want to be able to print an amps value in decimal to 2 decimal places?
- Attachments
-
- ADC_Int_3Expiriment.fcfx
- (9.76 KiB) Downloaded 129 times
-
- Valued Contributor
- Posts: 1189
- Joined: Wed May 31, 2017 11:57 am
- Has thanked: 70 times
- Been thanked: 439 times
- Contact:
Re: Convert Int to a decimal number
In a calculation use:
str = FloatToString$(value, 2) (or change 2 to required number of digits...)
Then print str.. (str defined a string variable..)
Martin
str = FloatToString$(value, 2) (or change 2 to required number of digits...)
Then print str.. (str defined a string variable..)
Martin
-
- Flowcode v5 User
- Posts: 25
- Joined: Sun Feb 01, 2009 5:32 pm
- Location: Albox, Almeria, Spain.
- Has thanked: 4 times
- Contact:
Re: Convert Int to a decimal number
Dear Martin,
Thank you for your help to date. Done as instructed. Now get to 2 decimal places but still printing only the whole number.
Sorry, I'm not very good with string manipulations etc. Please see amended as per attached.
Thank you for your help to date. Done as instructed. Now get to 2 decimal places but still printing only the whole number.
Sorry, I'm not very good with string manipulations etc. Please see amended as per attached.
- Attachments
-
- ADC_Int_3Expiriment.fcfx
- (10.16 KiB) Downloaded 115 times
-
- Valued Contributor
- Posts: 1189
- Joined: Wed May 31, 2017 11:57 am
- Has thanked: 70 times
- Been thanked: 439 times
- Contact:
Re: Convert Int to a decimal number
Sorry - not at computer now.. but is your value a float?
Just looked and it's an integer value - you'll need a floating point value for your result...
Martin
Just looked and it's an integer value - you'll need a floating point value for your result...
Martin
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Convert Int to a decimal number
Martin is correct.
I have change it for you.
Try the attached Flowchart.
I have change it for you.
Try the attached Flowchart.
- Attachments
-
- ADC_Int_3Expiriment2.fcfx
- (11.09 KiB) Downloaded 136 times
Martin