Could someone please help me with the code for below requirement or scenarios…I achieved 80 %, but stuck up with autoformatting…Its silly but new for me 🙁
Well my business user would like to feature for a big amount field textbox which should allow 2 decimal points only.i.e when she types 1000, it should be automatically formatted as “1,000.00” and when she types 1000000, it should be like “1,000,000.00” and when she types 1K, it should be formatted as automatically “1,000.00” and when she types 10000.23 it should be “10,000.23” and M/m should be million and b/B should be billion. Well I could achieve all these M/M, k/K etc and limitting the decimal only to 2 decimal points. Even I kept validation and all like it wont allow any characters except k/K,m/M,b/B,”.” and “,”. Please also remember, if user mentions just 2k, it should be “2,000.00” i.e I mean to say, if no values she keyin for decimal or no “.” in the number value in textbox, it should be that “number.00” against to 23333.32 which should appear as “23,333.32”
But I have a problem of implementing autoformatting the inputs with a coma for interval of every 3 digits starting from first digit to the left of decimal place. I am not sure how to do this autoformatting for coma… This should happen only when the user finishes keying in the input and presses tab. Please help me achieve this 🙁 I would be really greatful if you can share the sample code for me like above. (Please consider all scenarios I mentioned while we try for code for this) 🙂 Meanwhile I will also workout ways to achieve this…I know it might look silly to you, but new for me :(….thank you all….
When the text box loses focus: