FAQ
 
 
Cover  \ Exhibition  \ Learning  \ Reference  \ Download  \ Discourse   
      Language \ Environment \ Libraries \ Comparison
 
   
   
Abridged (A-Z) \ Complete (A-Z)  
   
  Reference for Processing (BETA) version 91+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.  
Name  

nfc()

   
Examples  
int i = 500000; 
String si = nfc(i); 
println(si);  // Prints "500,000" 
float f = 42525.34343; 
String fi = nfc(f, 2); 
println(fi);  // Prints "42,525.34" 
 

Description   Utility function for formatting numbers into strings and placing appropriate commas to mark units of 100. There are two versions, one for formatting ints and one for formatting an array of ints. The value for the digits parameter should always be a positive integer.
   
Syntax  
nfc(intValue)
nfc(floatValue, right)
   
Parameters  
intValue   int or int[]: the number(s) to format

floatValue   float or float[]: the number(s) to format

right   int: number of digits to the right of the decimal point

   
Returns   String or String[]
   
Usage   Web & Application
   
Related   nf()
nfs()
nfp()
 
 






   
 
Updated: Fri Jul 15 16:35:51 PDT 2005
 
 








Creative Commons License
 
  Processing is an open project initiated by Ben Fry and Casey Reas  
  © Info