Money Format
hi all
this following function i use to get currency format in javascript
any other methods is there
if anyone can
pls help me
function Formatmoney(A,W)
{
var WGdc=".";
var WGgc=",";
var WGnc="(";
var N=Math.abs(Math.round(A*100));
var S=((N<10)? "00" : ((N<100)?"0":""))+N;
S=((A<0)?WGnc:"")+
WGgroup(S.substring(0,(S.length-2)))+
WGdc+S.substring((S.length-2),S.length)+
((A<0 && WGnc=="(")? ")" : "");
return (S.lengh>W)?"over":S;
}
surendran
(Anything is Possible)
__________________
surendran
(Anything is Possible)
http://www.suren.info
http://ssuren.spaces.msn.com
|