You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
villares edited this page May 24, 2020
·
4 revisions
Nome
nf()
Exemplos
int a=200, b=40, c=90;
String sa =nf(a, 10);
println(sa); // Imprime "0000000200" String sb =nf(b, 5);
println(sb); // Imprime "00040" String sc =nf(c, 3);
println(sc); // Imprime "090" float d =200.94, e =40.2, f =9.012;
String sd =nf(d, 10, 4);
println(sd); // Imprime "0000000200.9400" String se =nf(e, 5, 3);
println(se); // Imprime "00040.200" String sf =nf(f, 3, 5);
println(sf); // Imprime "009.01200"
Descrição
Função utilitária para se
formatar números em strings. Há duas versões, uma
para formatar floats e outra para formatar ints. Os valores dos
parâmentros digitos, esquerda, e **direita **devem ser sempre números inteiros positivos.