views:

46

answers:

1

Hello people,

I'm developing a system in ASP.NET and I need a textbox mask to handle an input of floating-point numbers. I haven't yet found a javascript mask that would RESPECT the decimal point. I've tried several, including dFilter and "Mask JavaScript API" and none of them could do the job in a swift manner.

The numbers I need to deal are like the following:

0.123,456,789,012

12,345,678,890,123.000

1,234,567,890,123.123,456,789,012

I appreciate your help, if you could post a script here or indicate a JavaScript library I could use.

+1  A: 

ASP.NET Ajax Toolkit has a mask control.

MaskedEdit Demonstration

Carlos Loth
Thank you, but MaskedEdit is just a joke from microsoft.If I type 123.45 I get the following: 2,300,045.00
Lynx Kepler
In your samples, is the comma the thousand separator? and is the dot the decimal separator? I'm confusing about the sample `1,234,567,890,123.123,456,789,012`
Carlos Loth
Another question, do you want to be able to type only the digits? Or would you like to be able to also type the separators? The first approach, with fixed decimal and thousand blank spaces is simpler than the second.
Carlos Loth
I would like to type the separators.For example: I type 12345 then I type the dot then I type 67890 and I get 12,345.67890I'm using the comma as the thousands separator. and the period as the decimals separator. Here in brazil we use otherwise, but that is easy to adapt. That confusing example is the biggest floating point number I expect to be typed, it has a 13-digit integer part and a 12-digit decimal part.
Lynx Kepler