You are currently viewing the Java Espanol section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
i making a program, to help me to count my money at work; i need to know how i can work with cash example:
wen i type a number in my prompt like this 69 i get the result like this .69000000000001 so i need to know how to get just .69 cents.
somebody can help me please
you haven't mentioned the datatype u have used to stored the amount. Anyway as far as i understood about the problem, it is a basic rounding problem. You can use round() function to round the value of cash u got as output.