How can I set a value in a select-menu to "0.001"?
Is it possible to set a value in a "select" to a decimal, for example 0,001. I've tried with 0.001, 1E-03 and 0,001? How can I do that?
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Is it possible to set a value in a "select" to a decimal, for example 0,001. I've tried with 0.001, 1E-03 and 0,001? How can I do that?
Hi Nicklas,
Yes, do you have any problem with it?
Hi Katya!
Yes, when I do it, it just use the number before comma, in this case 0.
Should it work like the way I set the value?
Nicklas,
Did you try using a dot instead of a comma?
Yes. I've tried: 0,001 and 0.001 but it still comma cant be used and when I use dot, it just using the first number (in this case is 0, not 0.001)
Nicklas,
I'm not able to reproduce the issue. Could you please post a screenshot of that '0' and the exact steps you follow to reproduce the behaviour? Any string can be a value in Select component.
Sorry but I forgot to tell you that Im trying to use the value in JavaScript with math. So when I tried to for example 20,001, the answer is 0, not 0,002. But when I changing the value to for example 6 (26) then the answer is 12.
This is my script if it helps.
Number1 and number2 is a "Input" and select1 is a "Select". In the select I have to options: The first has value: 1 and the second has value: 0.001.
Script:
var one, two, three;
one = parseInt(Appery("number1".val());
two = parseInt(Appery("number2).val());
three = parseInt(Appery("select1).val());
alert(one(twothree));
Hi Nicklas,
Instead of parseInt() use parseFloat() - it converts a string to a number with floating point rather than integer.
YEAH!
Great!!! Thank you very much!