Results 1 to 4 of 4
Thread: Decimals in java help!!
- 12-09-2009, 10:51 PM #1
Member
- Join Date
- Dec 2009
- Posts
- 2
- Rep Power
- 0
Decimals in java help!!
hi
i need some help with java
ive got an assignment and 1 of the questions is 22 divided by 1000000 see i no the answer is 0.000022 but everytime i try it in bluej i keep gettin the answer as 0.0 ive tried float and double could anyone suggest another way for me to get my answer showing correctly
thank you
-
Your problem is that you're doing int division which always results in an int. try dividing 1.0 by 22.0
- 12-09-2009, 11:08 PM #3
Member
- Join Date
- Dec 2009
- Posts
- 2
- Rep Power
- 0
ok i tried that and it did not work :(
thanks for ur help
-
Similar Threads
-
number to word with decimals
By fertas in forum New To JavaReplies: 3Last Post: 08-30-2008, 03:12 AM -
Java Program To Convert A Number In To Words With Decimals
By javanewbie in forum New To JavaReplies: 1Last Post: 07-02-2008, 01:58 PM -
get more decimals?!?! please help!
By michcio in forum New To JavaReplies: 7Last Post: 05-22-2008, 10:26 PM
Bookmarks