Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes HTML, CSS and JavaScript and the fly likes possible we can turn Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "possible we can turn "0.5" to "1/2"" Watch "possible we can turn "0.5" to "1/2"" New topic
Author

possible we can turn "0.5" to "1/2"

Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 438
good day to all,

is it possible when a user enter "13.5" , then we convert it into "13 1/2" ?

thank you very much for guidance
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
If you code a function that does it.

Eric
Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 438
thanks for reply Eric Pascarello ,

in function , do we replace the value .5 to 1/2 or we have special function to insert the special character "1/2" ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

No, there are no special functions. This is something you'll have to come up with an alogrithm for on your own.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
wood burning stoves
 
subject: possible we can turn "0.5" to "1/2"
 
Similar Threads
ResultSet.close()
Occasional inaccuracy in addition calculations. Why?
JCAPS and JavaFX
JSP
What is the best third party print API available with robust print capabilities?