Wrox Programmer Forums
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 30th, 2004, 02:35 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default 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





Similar Threads
Thread Thread Starter Forum Replies Last Post
make some money! pipeisawesome C++ Programming 4 February 2nd, 2007 11:11 AM
convert nvarchar to money smatyk SQL Server 2000 2 October 26th, 2006 06:37 PM
Help even for money shemeri XSLT 1 August 28th, 2005 12:10 PM
How to change the length of "Money" hlchuah77 SQL Server 2000 4 November 16th, 2004 08:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.