Reference for the BALTENSPERGER programming language, an art project of Stefan Baltensperger

Name

nfs()

Examples
Ganzizahl a=200, b=-40, c=90; 
Satz sa = nfs(a, 10); 
schrib_uf_e_neui_Linie(sa); // prints " 0000000200" 
Satz sb = nfs(b, 5); 
schrib_uf_e_neui_Linie(sb); // prints "-00040" 
Satz sc = nfs(c, 3); 
schrib_uf_e_neui_Linie(sc); // prints " 090" 
 
Komazahl  d = -200.94, e = 40.2, f = -9.012; 
Satz sd = nfs(d, 10, 4); 
schrib_uf_e_neui_Linie(sd);  // prints "-0000000200.9400" 
Satz se = nfs(e, 5, 3); 
schrib_uf_e_neui_Linie(se);  // prints " 00040.200" 
Satz sf = nfs(f, 3, 5); 
schrib_uf_e_neui_Linie(sf);  // prints "-009.01200"
Description Utility function for formatting numbers into strings. Similar to machen_Satz_usdeZahl() but leaves a blank space in front of positive numbers so they align with negative numbers in spite of the minus symbol. There are two versions, one for formatting Komazahl s and one for formatting ints. The values for the digits, left, and right parameters should always be positive integers.
Syntax
nfs(Ganzizahl-Value, digits)
nfs(Komazahl Value, left, right)
Parameters
Ganzizahl-Value Ganzizahl or Ganzizahl[]: the number(s) to format
digits Ganzizahl: number of digits to pad with zeroes
Komazahl Value Komazahl or Komazahl []: the number(s) to format
left Ganzizahl: number of digits to the left of the decimal point
right Ganzizahl: number of digits to the right of the decimal point
Usage Web & Application
Related machen_Satz_usdeZahl()
nfp()
machen_Satz_us_de_Zahl_und_setz_es_Koma()
Stefan Baltensperger 2009

Creative Commons License