I am newbie to javascript and struggling to write regex pattern for the requirement
2,4 = 24.00
2.4 = 2.40
2.4.5 = 2.40
2.5,5 = 2.50
2,5.7 = 25.70
45.56.34 = 45.56
13.,0 = 13.00
13,.0 = 13.00
Only digits and comma and dot are allowed. it doesn't matter how they enter But i have to convert this into proper currency format xxx,xxx,xxx,xx.xx
edited: to clarify doubts
2,4 = 24.00, but2,5.7 = 2.50. I don't understand something.2,5.7become2.50instead of25.70, and why does2.4.5become2.40instead of2.45