开发者

Masking Currency for Regular Expression in C#

just a little help on how to mask number to make proper currency value in Regular Expression with comma.. i made it this far..

 ₱\d*\.\d{2}

and it will mask

from 3342.34 to ₱开发者_StackOverflow3342.34

how to mask it with comma for every 3 digits? :)

thanks in advance..


Seeing as you have to use regex, here is your answer:

₱(?>\d{3},)*\d{1,3}(>?\.\d{1,2})?$

This will accept:

  • ₱10
  • ₱100
  • ₱100,1
  • ₱1.1
  • ₱100,512,423.15
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜