float / floatstring example adc base decimal point / comma

Please add any feature requests for Flowcode version 6 here

Moderator: Benj

Forum rules
Only feature requests will be considered here. General questions should not be posted in this forum.
Post Reply
Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

float / floatstring example adc base decimal point / comma

Post by Rudi »

hi guys

perhabs this is possible:

i know, under windows system is possible to set language and decimal char too,
example if i set a float decimal char for german "12,01"
this is a comma

and if i check values in extern program like a "isfloat" function example in delpi, visual basic etc then the float deciamal char is base in windows system,
if it set to comma like format "12,01" then the test of floatstring will be true

in fc example adc base, there are icon macro
example
GetString
GetVoltage
this will return "12.01"
a dot as decimal for float.
this is ok .. but in german settings the dot is not a valid float decimal char ;-) it is a million or hundred tousand delimeter.. ..
1.000.000,00 = one million
1.000,00 = one tousend

is it possible to set in FC in a base float deciaml char?
is it possible to get the value as "12,01" without append function for change "." in "," ?
perhabs this in the macro possible to set in the properties, what char fc must take "." or ",".. or other.
this will be fine!..

hope the wish is declared understandly
thank you!
best wishes
rudi ;-)

btw
how are you guys`?
hope you are all fine ;-)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: float / floatstring example adc base decimal point / com

Post by Benj »

Hi Rudi,

It should be possible to do something, like maybe have a format string macro or replace character macro.

To go about something like this I would first take the length of the string variable and store in a len variable.

Then I would step through the string a character at a time until I had processed len bytes.

Code: Select all

len = Length$(str)
idx = 0
while (idx < len)
{
  if (str[idx] = '.')
   yes: str[idx] = ','
  idx = idx + 1
}
You could change the hardcoded ',' and '.' to parameters in a macro and this would allow you to search and replace any character in any string.

Post Reply