Jump to content

como fazer um printf ?


bfsm

Recommended Posts

Podes usar o format ou o printf em Java consoante o objetivo. Exemplos em:

http://javarevisited.blogspot.pt/2012/08/how-to-format-string-in-java-printf.html

para saberes mais sobre formatação vê: http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax

espero ter ajudado.

PS. se fosse em Javascript eu usaria isto: http://www.diveintojavascript.com/projects/javascript-sprintf

Link to comment
Share on other sites

* Movido para Java. Era demasiado estranho para ser javascript.

"[Os jovens da actual geração]não lêem porque não envolve um telecomando que dê para mirar e atirar, não falam porque a trapalhice é rainha e o calão é rei" autor: thoga31

Life is a genetically transmitted disease, induced by sex, with death rate of 100%.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.