Groups
Groups
Sign in
Groups
Groups
gujsmo
Conversations
About
Send feedback
Help
private void formatar
1 view
Skip to first unread message
Ivan
unread,
Jul 25, 2009, 8:25:25 AM
7/25/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gujsmo
private void formatar(){
NumberFormat nf = NumberFormat.getNumberInstance(totall);
DecimalFormat df = (DecimalFormat)nf;
df.applyPattern(totall);
String output = df.format(totall);
System.out.println(totall + " " + preco + " " +
totall.toString());
}
// esse é meu metodo
NumberFormat nf = NumberFormat.getNumberInstance(loc);
DecimalFormat df = (DecimalFormat)nf;
df.applyPattern(pattern);
String output = df.format(value);
System.out.println(pattern + " " + output + " " +
loc.toString());
// esse é o original
nao toh conseguindo organiza!!!!!
o q tah errado no meu!!!!
obrigado
Robert Lang
unread,
Jul 26, 2009, 2:42:31 PM
7/26/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to guj...@googlegroups.com
Prezado Ivan,
Pattern não é valor, pattern nesse caso é como uma máscara de formatação...
veja aqui:
http://java.sun.com/docs/books/tutorial/i18n/format/decimalFormat.html
e também aqui:
http://www.lazy8.nu/doc/numberformats.en.html
por exemplo, para formatar o valor 12345.67 aplicando o pattern $###,###.###
você terá como resultado $12,345.67
ok?
2009/7/25 Ivan
<
ivan_k...@hotmail.com
>
Reply all
Reply to author
Forward
0 new messages