|
Post by adri on Apr 22, 2022 23:00:15 GMT
Hello, i have a question,
When i execute the macro by entering a decimal value which contains a point "." ex : "0.01" The macro does not recognize the point (it disappears) and put "0" instead of "0.01"
Can u help me ?
|
|
|
Post by philranger on Apr 24, 2022 13:01:07 GMT
Hello, It’s hard ro say without seeing your code. I guess you tried the examples from www.turnssoft.com/conditions.html#decimal_variable ? I don’t know if MMM is influenced by this, but some countries use « , » instead of « . » as a decimal separator. I don’t know which country you are from either, so this is just me brainstorming. Please let us know if you find the solution!
|
|
|
Post by adri on Apr 25, 2022 12:25:00 GMT
link Hi, if i use a "," for decimal it works but i need a "." obligatorily. by the way im french
|
|
|
Post by philranger on Apr 26, 2022 16:46:10 GMT
Looks line it’s tied to Windows « international « settings. I’m from Quebec so I speak French too. So far I was able to get around the issue, but maybe Steve can let us know if he thinks something could be done?
|
|
|
Post by adri on Apr 27, 2022 13:49:14 GMT
so you think i can't do anything on my side ?
|
|
|
Post by cyberchipz on Apr 27, 2022 18:30:55 GMT
so you think i can't do anything on my side ? I've never used decimals; but, recently I need to calculate X and Y positions as a percentage of screen area; so I am keenly interested in this too; USA uses a period. If Phil is saying we can use a comma instead of the decimal; that will work for me; even though it will look strange; as long as it works; I'm good; but, yes... this could be an issue. Since I'll need an integer value for X,Y location; my workaround for this would be to multiply the number by a power of 10, and then divide by the power to get my value. Ex: 0.78 * 100 = 78 but, if I can't use 0.78... I would just multiply one or both values by 100 so 78 * 100 = 7800 (7800 / 100) = 78 and then to get 78 I would divide by 100. or if I have to multiply both values by 100, divide by 10000; so, with decimals 0.78 *100.98 (= 0.78 * 100) X (100.98 * 100) or 78 * 10098 = 787644 and 787644 / 10000 = 78.7644 and I never have to type a period. This would work with any number; but what I don't know is how the decimal value will be stored in the %DECIMAL% variable; either 78,7644 or 78.7644. It wouldn't matter to me, as long as I could use it. :-) So, I would just use the comma, it's easier than multiplying by powers of 10. ;-) It's a thinking and printing problem; but not a math problem.
|
|
|
Post by Steve on Apr 28, 2022 20:14:20 GMT
I don't think I'm following here... So this doesn't work?
1 | RUN ACTION | DEFINE DECIMAL VARIABLE | %DECIMAL%::1.1
|
|
|
Post by adri on May 5, 2022 16:46:21 GMT
any idea about the impossibility to create decimals with "."?
|
|
|
Post by philranger on May 7, 2022 14:49:11 GMT
I know it’s not great but I would copy the value to a notepad, replace the offensive character, then rrcopy
Ctrl-c, alt-tab, ctrl-a, ctrl-v, ctrl-h, . Tab. , enter, escape, ctrl a, crrl v or somthing similar
Sorry, I’m on my phone and cannot give a better answer
|
|
|
Post by adri on May 7, 2022 17:57:02 GMT
I did something like you with copy paste and it will be ok Thanks anyway !
|
|