nfc with left?
in
Programming Questions
•
2 years ago
Hello! I need to pad a number on the left, which is easy
with nf, but I also want commas such as nfc! However, nfc
only can pad right! Why is this/can someone help me make a workaround?
I tried this code:
int longNumber = 1000 //big number
String longNumberO= nf(longNumber, 10); //big number with 10 zeros in front
String longNumberOC = nfc(longNumberO); //big number with 10 zeros in front and commas
but I get the error: "The method nfc(int[]) in the type PApplet
is not applicable for the arguments (String)"
reference
Syntax
nf(intValue, digits)
nf(floatValue, left, right)
nfc(intValue)
nfc(floatValue, right)
1