MMC2 wrote:
> I want to format a number that is held in a string called s to have a
> leading $ sign and two places after the decimal point. So partly
> following an example I wrote
>
> static public String customFormat(String pattern, String s ) {
> DecimalFormat myFormatter = new DecimalFormat(pattern);
> String stringformatoutput = myFormatter.format(s);
> return stringformatoutput;
> }
>
>
> then in my code where I went to use this I wrote
>
> customFormat("$###,###.###", s);
> String t = stringformatoutput;
>
> hoping to have my formatted string ready for output in t, but I get an
> error message that stringformatoutput cannot be resolved.
>
> Can someone set me straight please
String t=customFormat("$###,###.###", s);
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy
Need Android talent? Ask on HADO! http://wiki.andmob.org/hado
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---