I like to get a decimal number with at most 2 digits before and to decimals behind the comma as Input of a text field. I did this by using
TextField1.ValidationMask = “99\,99”
The Documentation says:“You can set the ValidationMask property in the Properties pane.” But if I try to add a property to the text field I get to the Window
properties and it doesn’t work. Now I placed the code in the window-open-event handler. It works, but is this the right place?
2.) Next to the text field I placed a slider to quickly change the value of the textField. The slider varies from 0 to 9999, but in the textfield I like to see the values as 0…99,99.
I can’t find an easy way to insert a comma on 3rd place in a string. Or do I have to convert to a double and divide by 100 and then convert to a string? The Format-Option didn’t work to the slider.value.
Wow, Problem 2 is solved. I am very impressed! I’ve been trying to do this for hours. Thanks a lot!
But I don’t understand, why does “#,###.##” work? Why not “##,##”?
LOL… guessing you are NOT in the US… the format statement uses “,” for thousands and “.” for decimal even if your locale is the opposite of that
[quote]
Although the special formatting characters are U.S. characters, the actual characters that will appear are based on the current operating system settings. For example, Windows uses the settings in the user’s Regional and Language Options Control Panel. Formatting characters are specified in similar ways on other operating systems.[/quote]
Yes, I’m from Germany
If the slider has the Value 0 then “0,” appears in the text field. Is there a possibility to get rid of the comma if the 0 is standing alone?