/ Published in: ActionScript 3
what more can i say?! Just a small Regular expression...
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public function setThousands(value:String):String { var pattern:RegExp = /(\d+)(\d{3}(\.|,|$))/gi; var str:String = value; while (str.match(pattern).length != 0) { str = (str.replace(pattern, "$1.$2")); } return str; }