: Java 1.5 and later: Floats are automatically changed to strings,
: when added to a string:
:
:
: float f = 4;
: String s = "2 * 2 = "+f;
: System.out.println(s);
:
:
:
: Java 1.4 and earlier: Use the String.valueOf() method:
:
:
: float f = 4;
: String s = "2 * 2 = "+String.valueOf(f);
: System.out.println(s);
:
:
:
: In Java 1.5 and later it is possible to have more control over how
: the number is displayed. For this you can use either the
: String.format() method or the Formatter class. See JavaDoc for a
: more detailed explanation.
the String.format() method only convert the number to char and print it in certin way... I'll make use of that too...
But what I want is a class or lib such that given a number, lets say 34.95 it returns "tirty four box(es?) 95c" or in spanish "treinta y cuatro pesos 95c"