Hi,
I have a little problem. How can I change the “.” to a “,” because in Germany and Austria we are using a comma instead of a dot.
So and now I have a calculation and if I type in 22,2 for example the result is wrong but if I type in 22.2 the result is right :-/ I am verry confused why the “,” isn’t working
Is there any way to enable the comma??
you mean that in Germany and Austria you write two and half like 2,5 rather than 2.5? I’ve never heard of that before, surely when coding numbers you must still have to use 2.5 not 2,5? I thought it was universal :?
you mean that in Germany and Austria you write two and half like 2,5 rather than 2.5? I've never heard of that before, surely when coding numbers you must still have to use 2.5 not 2,5? I thought it was universal :?
thanks for the quick reply, I think in many countries 2,5 is used instead of 2.5. Please correct me If I am in the wrong site but I think there is no way to say Flash enable the comma instead of the dot
Is there any way to listen if the user types for example 2,5 in a textfield with a notifications which informs the user that he/she has to use the dot instead of the comma?
We too use 2,5 instead of 2.5 here in the Netherlands (we actually say 2 comma 5, not 2 dot 5). But once you get to higher schools, they start to teach you that you should forget about the comma, and use dots instead. So some people learn that, others dont.
Personally, I like the dot over the comma, but thats prob cause Im a coder
We too use 2,5 instead of 2.5 here in the Netherlands (we actually say 2 comma 5, not 2 dot 5) ...
When we use the dot we say “two point five” - I’ve never heard of anyone saying “two dot five”
They use (and say) the comma in South Africa too. Confused the heck out of me when I first moved there
designmonster: If you want to allow number entry with commas for decimals use a text “relpace” function before using entry as a number:
var decimal:String = "2,5";
var comma:RegExp = /,/;
trace(decimal.replace(comma, "."));
We too use 2,5 instead of 2.5 here in the Netherlands (we actually say 2 comma 5, not 2 dot 5). But once you get to higher schools, they start to teach you that you should forget about the comma, and use dots instead. So some people learn that, others dont.
Personally, I like the dot over the comma, but thats prob cause Im a coder
Massive +1.
This is one of the main reasons why it was so great to be taught maths in English (Bilingual edutation ) - I’ve been drilled to use the dot rather than the comma, and I’m appaled when I’m forced to use it at economics (which is taught in Dutch). I usually write in a mixture of comma’s and dots, although when coding it’s 100% dots for me and I honestly can’t remember that this felt off at any point
In think, basically Comma is not use as a mathematical number, but most of the country use common to mention the money value. So if you receive the money data using text field you must write the code to remove all commas.
Dot is a numeric, we don’t use as a separator in any way
late but there is my solution for this "problem" and it works 100%
var yourString:String = yourTextfield.text;
while (yourString.search(";") != -1) {
yourString = yourString.replace(",",".");
}
put this lines in your calculation… thats it!
Never thought that it is so simple.
Should that have been a comma instead of a semi-colon in the ‘while’ termination condition? Otherwise you have an infinite loop (or one that never executes depending on whether yourString contains a semi-colon)
You don’t need to use a loop to replace globally; there is a ‘global’ replace flag (‘g’) you can add to regular expressions:
This will replace all instances of “,” in yourString with “.”
var allCommas:RegExp = /,/g;
yourString = yourString.replace(allCommas, ".");
the split() function turns your string into an array, separated by character you specify. And the join() function turns the new array back to a string, joining the separate values by the character you specify as well.
you mean that in Germany and Austria you write two and half like 2,5 rather than 2.5? I've never heard of that before, surely when coding numbers you must still have to use 2.5 not 2,5? I thought it was universal :?