Link to home
Start Free TrialLog in
Avatar of ferguson_jerald
ferguson_jerald

asked on

How to make the last two numbers typed into a asp:textbox decimals?

Hello Experts,

I have an asp:textbox with the following regular expression validator:

<asp:RegularExpressionValidator ID="rev_case_exp_cost_txt" runat="server" ControlToValidate="case_exp_cost_txt" Type="Integer" Operator="DataTypeCheck" ErrorMessage="Invalid Format" ValidationExpression="^\d{1,11}(?:\.\d\d)?$"></asp:RegularExpressionValidator>

Open in new window


How can I get it to automatically make the last two numbers entered as the decimals?  For example, if the user types 300, it should show 3.00 after they tab out of the field - or 50000 would be 500.00.  

I am using asp.net and c#.

Any help would be greatly appreciated.

Thanks,
J
SOLUTION
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ferguson_jerald
ferguson_jerald

ASKER

I tested both suggestions and they both worked!  Thanks for the help.