Thousand Seperators in Textboxes

Thousand Seperators in Textboxes

  
I've been racking my brain about this for a while. I really need to show thousand separators in text boxes to make large numbers easier to read. Been thinking that Javascript might be the way to do this, although getting my head around how to implement it within OS is quite tricky without some good practical experience.

I've checked out some code here which looks like it should do what I want:

http://stackoverflow.com/a/6691682

Anyone able to help me out with implementing this at all? Or tell me that it's impossible! Thinking the best start is to see if I can at least take something someone has typed and show it with thousand seperators before I try to do the reverse before I submit within a widget.

Let me know what you think.

Tom
Hey Tom, take a look at the Input Masks component.

You can use 
  • CurrencyMask(DecimalSeparator:",",Decimals:,GroupSeparator:".",True,AllowNegative:,True,ShowSymbol:,Symbol:,PersistentSymbol:)
as MaskDefinition.

Just remember that by doing this, you will render decimal values invalid to the platform. (As the platform's decimal separator is "." (not ",") and it doesn't support thousand separator).

This means your textboxes will have to be bound to a Text variable, and then before saving the data you need to parse that text, like so TextToDecimal(Replace(Replace(MyTextVariable,".",""),",",".")

Best regards,
Thanks Antonio, enfact I looked at your component previously but never got around to using it properly. Thanks for giving me the lowdown, I already have your component half working, but I do need a touch of help when it comes to a list widget.

I have a list widget that also allows you to edit the information inside. Any text boxes have an OnChange action that saves the values to a Record variable that is then saved. If I need to bind text boxes to text variables, what is the best way to work around the fact that the Lists record list has number values to populate the textboxes initially?

Hope that makes sense!

Cheers,

Tom
Tom Ellingham wrote:
Thanks Antonio, enfact I looked at your component previously but never got around to using it properly. Thanks for giving me the lowdown, I already have your component half working, but I do need a touch of help when it comes to a list widget.

I have a list widget that also allows you to edit the information inside. Any text boxes have an OnChange action that saves the values to a Record variable that is then saved. If I need to bind text boxes to text variables, what is the best way to work around the fact that the Lists record list has number values to populate the textboxes initially?

Hope that makes sense!

Cheers,

Tom
 
 Glad I could help.
If your source RecordList for that list widget is a simple query, just add a Text structure to that query, and cycle through the results assigning that text value with the decimal value from that same row. Remember you also have to cycle and assign after query refreshes.
The text boxes inside the list would be bound to that text attribute, and you can just do the parsing when saving :)