Thread: Long Division

Results 1 to 4 of 4
  1. #1 Long Division 
    Registered Member
    Join Date
    May 2011
    Posts
    312
    Thanks given
    14
    Thanks received
    17
    Rep Power
    0
    So we already know I have a division system which shows the follow..


    Kills/Deaths - The thing is with this even if I do that division if I have 11 Kills and 5 Deaths it still says just 2.


    My question is how to make it go to lets say 2 decimal places?
    I'm in this bitch with the terror, got a hand full of stacks better grab an umbrella I make it rain.
    Reply With Quote  
     

  2. #2  
    Extreme Donator

    Dylan's Avatar
    Join Date
    Jan 2008
    Posts
    399
    Thanks given
    31
    Thanks received
    10
    Rep Power
    366
    float ratio = kills / deaths;

    system.out.printf("Kill Death Ratio: %0.2f", ratio);

    try that
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    May 2011
    Posts
    312
    Thanks given
    14
    Thanks received
    17
    Rep Power
    0
    Sorry was reading up about it on Google, figured it out.


    Using Double.

    If anyone needs

    double Ratio = (double) kills / (double) deaths;
    I'm in this bitch with the terror, got a hand full of stacks better grab an umbrella I make it rain.
    Reply With Quote  
     

  4. #4  
    q.q


    Join Date
    Dec 2010
    Posts
    6,519
    Thanks given
    1,072
    Thanks received
    3,535
    Rep Power
    4752
    use a double or a float
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Joy Division
    By ICEAuthority in forum Music
    Replies: 3
    Last Post: 12-17-2011, 09:05 AM
  2. Division Gamers
    By Mini in forum Projects
    Replies: 4
    Last Post: 12-15-2009, 01:46 AM
  3. Division Chart
    By thatwasonce in forum Application Development
    Replies: 4
    Last Post: 12-11-2009, 10:55 PM
  4. Haven't made one in a long long time
    By Karma in forum Showcase
    Replies: 4
    Last Post: 10-17-2008, 02:14 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
  •