Results 1 to 2 of 2

Thread: Adding in JS

  1. #1
    Join Date
    Jan 2008
    Posts
    3

    Adding in JS

    Hello everyone,

    I have a question on addition in JS. First off, I work for an independant agent under AT&T. My boss owns five stores that fax over cashsheets everyday. My boss then asked me to make an online cashsheet, to email to him the cashsheets, which I did. Then he asked if I could have the amounts total which i did....kinda. This is my JS . I'm a novice at this stuff but I think i have it placed right.

    Everything has worked up to a point though. What i have setup is this:

    Total Drawer Start Drawer Bag Money

    $.01 Money money blah blah
    $.05
    $.10
    $.25
    $1
    $5
    $10
    $20
    $50
    $100

    Ok, thats how I ahve it setup not including the check amounts or the creidt card amounts but thats all working. What isn't working is that if I place( within any of the cents sections) more than .99 as in .99 cents in change. it give me amount that have 10 decimal places. For example: 3.30 in dimes messed it up, but .30 didn't.

    At first, as you can see that i have parseFloat on each one of the formulas, I didn't have parseInt wish didn't allow me to calculate decimals.

    So hopefully I have given enough to get some help on this.

    Thanx a lot guys

    P.S. If there is a way, is it posible to have these amount total automatically in the Totals boxes, instead of me clicking a button.

  2. #2
    Join Date
    Jan 2008
    Posts
    3
    Quote Originally Posted by Ventu
    Hello everyone,

    I have a question on addition in JS. First off, I work for an independant agent under AT&T. My boss owns five stores that fax over cashsheets everyday. My boss then asked me to make an online cashsheet, to email to him the cashsheets, which I did. Then he asked if I could have the amounts total which i did....kinda. This is my JS . I'm a novice at this stuff but I think i have it placed right.

    Everything has worked up to a point though. What i have setup is this:

    Total Drawer Start Drawer Bag Money

    $.01 Money money blah blah
    $.05
    $.10
    $.25
    $1
    $5
    $10
    $20
    $50
    $100

    Ok, thats how I ahve it setup not including the check amounts or the creidt card amounts but thats all working. What isn't working is that if I place( within any of the cents sections) more than .99 as in .99 cents in change. it give me amount that have 10 decimal places. For example: 3.30 in dimes messed it up, but .30 didn't.

    At first, as you can see that i have parseFloat on each one of the formulas, I didn't have parseInt wish didn't allow me to calculate decimals.

    So hopefully I have given enough to get some help on this.

    Thanx a lot guys

    P.S. If there is a way, is it posible to have these amount total automatically in the Totals boxes, instead of me clicking a button.
    alirght I guess I didn't explain myself good enough :P. Thats ok I have an image.


    If I were to change the $.01 to 1, to signify 1 dollar in pennies it would give me 2 decimal places. Also if i gave Dimes a 1 dollar amount it would go bac kto normal also.

Similar Threads

  1. Adding Votes
    By donkeyangel in forum General Questions
    Replies: 1
    Last Post: 02 Nov 2006, 02:46 AM
  2. [Help] Adding db tables via phpMyAdmin
    By nawafj in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 08 Jun 2006, 07:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •