dcsimg
Results 1 to 8 of 8

Thread: currency problem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    163

    currency problem

    Ok, Maybe a fresh pair of eyes will fix this, i can't seem to get it

    With settings
    If ck1.Value = Checked Then
    txtsub = txtsub + !roadclean
    ElseIf ck1.Value = Unchecked Then
    txtsub = txtsub - !roadclean
    End If

    If !addsalestax.Value = True Then
    thetax = !salestax
    TaxNumber = thetax * 100
    endtax = !roadclean * TaxNumber
    txttax = endtax / 100
    txttax = Format(txttax, "Currency")


    it's displaying the right amount (276), however it displays it like this 276.00 or 276.00, and i can't get it to display like 2.76

    I've tried every formatting combo I could think of to no avail
    If this post has helped you please rate it by clicking the scales to the left of this post!

  2. #2
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011

    Re: currency problem

    What is the value of txttax?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    163

    Re: currency problem

    txttax in this case comes out to 276, it's being formatted as 276.00 when i need it formatted to 2.76, or maybe find the two rightest chars then put them in a variable, trim them, add a decimal, and put them back. I don't know but there has got to be an easier way.
    If this post has helped you please rate it by clicking the scales to the left of this post!

  4. #4
    New Member aStrat's Avatar
    Join Date
    Aug 2006
    Posts
    14

    Re: currency problem

    If it's being formatted to 276.00 and you want 2.76 isn't it giving you the wrong output?

  5. #5
    Hyperactive Member
    Join Date
    Sep 2005
    Posts
    376

    Re: currency problem

    add

    txttax = txttax / 100

    before

    txttax = Format(txttax, "Currency")

  6. #6
    Hyperactive Member
    Join Date
    Aug 2004
    Location
    Itasca, IL USA
    Posts
    266

    Re: currency problem

    seems like you can just cut the part of the code out where you multiply it by 100...

    If !addsalestax.Value = True Then
    endtax = !roadclean * !salestax
    txttax = endtax / 100
    txttax = Format(txttax, "Currency")

  7. #7
    Hyperactive Member
    Join Date
    Sep 2005
    Posts
    376

    Re: currency problem

    With chrissy's solution while the txttax will reflect the value you want you should note that the final value of endtax will be (what you currently end up with / 100). If that doesn't matter then you'll be fine just removing that line.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    163

    Resolved Re: currency problem[RESOLVED]

    thnx
    If this post has helped you please rate it by clicking the scales to the left of this post!

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width