I want to format the number with DecimalFormat pattern symbol. Any idea to do??
Ex: ### 123 dollars and 00 cents ###
where 123 is need to formatted using DecimalFormat.format method
In C#, it is possible with escape("\") character. Is there any similar way in java?
double value = 123;
Console.WriteLine(value.ToString("\\#\\#\\# ##0 dollars and \\0\\0 cents \\#\\#\\#"));
Thanks in Advance
Just concatenate the characters to the beginning and end of the string.
It's more readable that way anyway.