Results 1 to 4 of 4

Thread: Percentages

  1. #1
    Ciwan is offline Banned
    Join Date
    Dec 2008
    Location
    Earth
    Posts
    87
    Rep Power
    0

    Exclamation Percentages

    Hi Guys

    I need help with working out percentages in java !!

    Say I have a field called [ Balance ]

    and I want to add 3.5% of what ever value is in the field balance to itself (i.e. add it back onto balance)

    How do I do it ?

    I'd greatly appreciate any help.

    Thanks

  2. #2
    MK12's Avatar
    MK12 is offline Senior Member
    Join Date
    Jan 2009
    Posts
    185
    Rep Power
    10

    Default

    balance = 30.00; // make this whatever you want
    ----now you can do this--------
    balance += balance * 0.035;
    ----OR THIS---------
    balance += balance * (3.5 / 100);
    --OR THIS----------
    percent = 3.5;
    balance += balance * (percent / 100);
    -----------------------
    Hope this helps.
    -MK12
    Tell me if you want a cool Java logo avatar like mine and I'll make you one.

  3. #3
    Ciwan is offline Banned
    Join Date
    Dec 2008
    Location
    Earth
    Posts
    87
    Rep Power
    0

    Default

    Thanks MK12 that was EXACTLY what I needed to know :)

    Your help is greatly appreciated. :)

  4. #4
    MK12's Avatar
    MK12 is offline Senior Member
    Join Date
    Jan 2009
    Posts
    185
    Rep Power
    10

    Default

    Your very Welcome. Please go to the top of this page and click "Thread Tools" and then in the drop-down menu, pick "Mark this Thread As Solved", so no one will waste time looking at it.
    Tell me if you want a cool Java logo avatar like mine and I'll make you one.

Similar Threads

  1. Qadratic Formula and Percentages
    By bbtgirl in forum JCreator
    Replies: 4
    Last Post: 02-07-2009, 04:07 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
  •