@@ -9476,28 +9476,6 @@ static final public String[] str(float x[]) {
9476
9476
9477
9477
// INT NUMBER FORMATTING
9478
9478
9479
-
9480
- static public String nf(float num) {
9481
- int inum = (int) num;
9482
- if (num == inum) {
9483
- return str(inum);
9484
- }
9485
- return str(num);
9486
- }
9487
-
9488
-
9489
- static public String[] nf(float[] num) {
9490
- String[] outgoing = new String[num.length];
9491
- for (int i = 0; i < num.length; i++) {
9492
- outgoing[i] = nf(num[i]);
9493
- }
9494
- return outgoing;
9495
- }
9496
-
9497
-
9498
- /**
9499
- * Integer number formatter.
9500
- */
9501
9479
static private NumberFormat int_nf;
9502
9480
static private int int_nf_digits;
9503
9481
static private boolean int_nf_commas;
@@ -9517,13 +9495,34 @@ static public String[] nf(float[] num) {
9517
9495
*
9518
9496
* ( end auto-generated )
9519
9497
* @webref data:string_functions
9520
- * @param nums the numbers to format
9521
- * @param digits number of digits to pad with zero
9498
+ * @param num the number to format
9522
9499
* @see PApplet#nfs(float, int, int)
9523
9500
* @see PApplet#nfp(float, int, int)
9524
9501
* @see PApplet#nfc(float, int)
9525
9502
* @see <a href="https://processing.org/reference/intconvert_.html">int(float)</a>
9526
9503
*/
9504
+ static public String nf(float num) {
9505
+ int inum = (int) num;
9506
+ if (num == inum) {
9507
+ return str(inum);
9508
+ }
9509
+ return str(num);
9510
+ }
9511
+
9512
+ /**
9513
+ * @param nums the numbers to format
9514
+ */
9515
+ static public String[] nf(int[] nums) {
9516
+ String[] outgoing = new String[nums.length];
9517
+ for (int i = 0; i < nums.length; i++) {
9518
+ outgoing[i] = nf(nums[i]);
9519
+ }
9520
+ return outgoing;
9521
+ }
9522
+
9523
+ /**
9524
+ * @param digits number of digits to pad with zero
9525
+ */
9527
9526
static public String[] nf(int nums[], int digits) {
9528
9527
String formatted[] = new String[nums.length];
9529
9528
for (int i = 0; i < formatted.length; i++) {
@@ -9532,10 +9531,6 @@ static public String[] nf(int nums[], int digits) {
9532
9531
return formatted;
9533
9532
}
9534
9533
9535
- /**
9536
- * @param num the number to format
9537
- * @param digits number of digits to pad with zero
9538
- */
9539
9534
static public String nf(int num, int digits) {
9540
9535
if ((int_nf != null) &&
9541
9536
(int_nf_digits == digits) &&
@@ -9703,8 +9698,6 @@ static public String[] nf(float nums[], int left, int right) {
9703
9698
9704
9699
/**
9705
9700
* @param num the number to format
9706
- * @param left number of digits to the left of the decimal point
9707
- * @param right number of digits to the right of the decimal point
9708
9701
*/
9709
9702
static public String nf(float num, int left, int right) {
9710
9703
if ((float_nf != null) &&
0 commit comments