let>DECIMAL_SEPARATOR=,
let>a=9,1
let>b=10,2
if>%a%>%b%
messagemodale>yes
else>
messagemodale>no
endif>
Hi i get yes i expected no whats wrong? if i use decimal point i get expected result??
decimal point and compare
Moderators: JRL, Dorian (MJT support)
Re: decimal point and compare
Hi erik,
If decimal works for you, why are you trying to use comma? I know some countries use comma instead. I guess what I am asking is what is the purpose for this macro. This is difficult to express. I'm thinking you may need to process information that has commas and not decimals. The reason I ask, is if decimal is an option, and it isn't giving you a problem then...... But you might consider using StringReplace> to replace commas with a decimal, just before you process it. And if need be you could replace it in reverse after you check or do whatever you are doing.
Maybe something like this.
I'm just suggesting it may be the easier route to take.
PepsiHog
If decimal works for you, why are you trying to use comma? I know some countries use comma instead. I guess what I am asking is what is the purpose for this macro. This is difficult to express. I'm thinking you may need to process information that has commas and not decimals. The reason I ask, is if decimal is an option, and it isn't giving you a problem then...... But you might consider using StringReplace> to replace commas with a decimal, just before you process it. And if need be you could replace it in reverse after you check or do whatever you are doing.
Maybe something like this.
Code: Select all
let>Input=782365,1
StringReplace>Input,comma,.,NewInput
mdl>%NewInput%
...rest of program.
StringReplace>NewInput,.,comma,Input
mdl>%Input%
...rest of rest of program.
PepsiHog
Windows 7
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
Re: decimal point and compare
Thank you i edited the program now its working.
It looks like the decimal point separator setting to comma does not change the numbers to floats but keeps them of type text thats why the compare does not function correctly. All my files i process have numbers with comma as decimal. So i need to need to do the stringreplace to do with each number which i read from a file.
let>DECIMAL_SEPARATOR=,
let>a=9,1
let>b=10,2
let>DECIMAL_SEPARATOR=.
StringReplace>a,comma,.,NewA
StringReplace>b,comma,.,NewB
//mdl>%NewA%
if>%NewA%>%NewB%
messagemodale>yes
else>
messagemodale>no
endif>
It looks like the decimal point separator setting to comma does not change the numbers to floats but keeps them of type text thats why the compare does not function correctly. All my files i process have numbers with comma as decimal. So i need to need to do the stringreplace to do with each number which i read from a file.
let>DECIMAL_SEPARATOR=,
let>a=9,1
let>b=10,2
let>DECIMAL_SEPARATOR=.
StringReplace>a,comma,.,NewA
StringReplace>b,comma,.,NewB
//mdl>%NewA%
if>%NewA%>%NewB%
messagemodale>yes
else>
messagemodale>no
endif>
Re: decimal point and compare
Hi erik,
Hey! Awesome! I'm glad you were able to get it to work. Great job. I'm gonna call and see that they give you a well deserved raise.
PepsiHog
[edit] - Just as a side note, in your actual script you shouldn't need to specify the separator any longer. You're processing the info and the separator now shouldn't matter.
Hey! Awesome! I'm glad you were able to get it to work. Great job. I'm gonna call and see that they give you a well deserved raise.

PepsiHog
[edit] - Just as a side note, in your actual script you shouldn't need to specify the separator any longer. You're processing the info and the separator now shouldn't matter.
Windows 7
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
- Dorian (MJT support)
- Automation Wizard
- Posts: 1415
- Joined: Sun Nov 03, 2002 3:19 am
Re: decimal point and compare
This has been fixed in dev, and will be in an upcoming update.
- Dorian (MJT support)
- Automation Wizard
- Posts: 1415
- Joined: Sun Nov 03, 2002 3:19 am
Re: decimal point and compare
This was released today. V15.0.17. Version History.