Results 1 to 3 of 3
- 09-23-2010, 07:35 PM #1
Member
- Join Date
- Sep 2010
- Location
- Southwest Missouri
- Posts
- 97
- Rep Power
- 0
Converting whole number into decimal
In one of my class exercises, I have to write a program that reads certain employee information and prints a payroll statement. I have to write it once using dialog boxes for input/output and again using console input/output.
One of the fields is the federal tax withholding rate. I have it set up so that I can enter a number (i.e., 20). What I need to do is convert that 20 into .20 and display it. I know how to display it but cannot figure out how to convert it.:confused:
- 09-23-2010, 07:52 PM #2
You want to convert 20 to .20? Divide by 100.0
You want to do floating division not integer division.
- 09-23-2010, 07:58 PM #3
Member
- Join Date
- Sep 2010
- Location
- Southwest Missouri
- Posts
- 97
- Rep Power
- 0
Similar Threads
-
Store the decimal number into an variable
By fataguila in forum New To JavaReplies: 4Last Post: 02-01-2010, 07:22 PM -
A Number Converting Program!
By WastedxYears in forum New To JavaReplies: 2Last Post: 01-09-2010, 12:47 AM -
converting a decimal to an int
By shuks in forum New To JavaReplies: 9Last Post: 10-12-2009, 09:41 AM -
converting decimal to binary value using recursion in java
By Anindo in forum New To JavaReplies: 3Last Post: 07-25-2009, 01:44 PM -
Converts a binary number to a decimal
By cachi in forum New To JavaReplies: 1Last Post: 08-01-2007, 09:57 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks