Tabnine Logo
PApplet.nfs
Code IndexAdd Tabnine to your IDE (free)

How to use
nfs
method
in
processing.core.PApplet

Best Java code snippets using processing.core.PApplet.nfs (Showing top 13 results out of 315)

origin: ajavamind/Processing-Cardboard

static public String[] nfs(int num[], int digits) {
  String formatted[] = new String[num.length];
  for (int i = 0; i < formatted.length; i++) {
    formatted[i] = nfs(num[i], digits);
  }
  return formatted;
}
origin: ajavamind/Processing-Cardboard

/**
 * Number formatter that takes into account whether the number
 * has a sign (positive, negative, etc) in front of it.
 */
static public String[] nfs(float num[], int left, int right) {
  String formatted[] = new String[num.length];
  for (int i = 0; i < formatted.length; i++) {
    formatted[i] = nfs(num[i], left, right);
  }
  return formatted;
}
origin: org.processing/core

/**
* @param left the number of digits to the left of the decimal point
* @param right the number of digits to the right of the decimal point
*/
static public String[] nfs(float nums[], int left, int right) {
 String formatted[] = new String[nums.length];
 for (int i = 0; i < formatted.length; i++) {
  formatted[i] = nfs(nums[i], left, right);
 }
 return formatted;
}
origin: org.processing/core

/**
 * @param nums the numbers to format
 */
static public String[] nfs(int nums[], int digits) {
 String formatted[] = new String[nums.length];
 for (int i = 0; i < formatted.length; i++) {
  formatted[i] = nfs(nums[i], digits);
 }
 return formatted;
}
origin: ajavamind/Processing-Cardboard

/**
 * This does a basic number formatting, to avoid the
 * generally ugly appearance of printing floats.
 * Users who want more control should use their own nf() cmmand,
 * or if they want the long, ugly version of float,
 * use String.valueOf() to convert the float to a String first.
 */
public void text(float num, float x, float y) {
 text(PApplet.nfs(num, 0, 3), x, y);
}
origin: org.processing/core

/**
 * This does a basic number formatting, to avoid the
 * generally ugly appearance of printing floats.
 * Users who want more control should use their own nf() cmmand,
 * or if they want the long, ugly version of float,
 * use String.valueOf() to convert the float to a String first.
 *
 * @param num the numeric value to be displayed
 */
public void text(float num, float x, float y) {
 text(PApplet.nfs(num, 0, 3), x, y);
}
origin: ajavamind/Processing-Cardboard

public void text(float num, float x, float y, float z) {
 text(PApplet.nfs(num, 0, 3), x, y, z);
}
origin: org.processing/core

public void text(float num, float x, float y, float z) {
 text(PApplet.nfs(num, 0, 3), x, y, z);
}
origin: org.processing/core

public void print() {
 int big = (int) abs(max(PApplet.max(abs(m00), abs(m01), abs(m02)),
             PApplet.max(abs(m10), abs(m11), abs(m12))));
 int digits = 1;
 if (Float.isNaN(big) || Float.isInfinite(big)) {  // avoid infinite loop
  digits = 5;
 } else {
  while ((big /= 10) != 0) digits++;  // cheap log()
 }
 System.out.println(PApplet.nfs(m00, digits, 4) + " " +
           PApplet.nfs(m01, digits, 4) + " " +
           PApplet.nfs(m02, digits, 4));
 System.out.println(PApplet.nfs(m10, digits, 4) + " " +
           PApplet.nfs(m11, digits, 4) + " " +
           PApplet.nfs(m12, digits, 4));
 System.out.println();
}
origin: ajavamind/Processing-Cardboard

public void print() {
 int big = (int) abs(max(PApplet.max(abs(m00), abs(m01), abs(m02)),
             PApplet.max(abs(m10), abs(m11), abs(m12))));
 int digits = 1;
 if (Float.isNaN(big) || Float.isInfinite(big)) {  // avoid infinite loop
  digits = 5;
 } else {
  while ((big /= 10) != 0) digits++;  // cheap log()
 }
 System.out.println(PApplet.nfs(m00, digits, 4) + " " +
           PApplet.nfs(m01, digits, 4) + " " +
           PApplet.nfs(m02, digits, 4));
 System.out.println(PApplet.nfs(m10, digits, 4) + " " +
           PApplet.nfs(m11, digits, 4) + " " +
           PApplet.nfs(m12, digits, 4));
 System.out.println();
}
origin: poqudrof/PapARt

output.append(PApplet.nfs(matrix.m00, digits, 4) + " "
    + PApplet.nfs(matrix.m01, digits, 4) + " "
    + PApplet.nfs(matrix.m02, digits, 4) + " "
    + PApplet.nfs(matrix.m03, digits, 4) + "\n");
output.append(PApplet.nfs(matrix.m10, digits, 4) + " "
    + PApplet.nfs(matrix.m11, digits, 4) + " "
    + PApplet.nfs(matrix.m12, digits, 4) + " "
    + PApplet.nfs(matrix.m13, digits, 4) + "\n");
output.append(PApplet.nfs(matrix.m20, digits, 4) + " "
    + PApplet.nfs(matrix.m21, digits, 4) + " "
    + PApplet.nfs(matrix.m22, digits, 4) + " "
    + PApplet.nfs(matrix.m23, digits, 4) + "\n");
output.append(PApplet.nfs(matrix.m30, digits, 4) + " "
    + PApplet.nfs(matrix.m31, digits, 4) + " "
    + PApplet.nfs(matrix.m32, digits, 4) + " "
    + PApplet.nfs(matrix.m33, digits, 4) + "\n");
origin: org.processing/core

System.out.println(PApplet.nfs(m00, digits, 4) + " " +
          PApplet.nfs(m01, digits, 4) + " " +
          PApplet.nfs(m02, digits, 4) + " " +
          PApplet.nfs(m03, digits, 4));
System.out.println(PApplet.nfs(m10, digits, 4) + " " +
          PApplet.nfs(m11, digits, 4) + " " +
          PApplet.nfs(m12, digits, 4) + " " +
          PApplet.nfs(m13, digits, 4));
System.out.println(PApplet.nfs(m20, digits, 4) + " " +
          PApplet.nfs(m21, digits, 4) + " " +
          PApplet.nfs(m22, digits, 4) + " " +
          PApplet.nfs(m23, digits, 4));
System.out.println(PApplet.nfs(m30, digits, 4) + " " +
          PApplet.nfs(m31, digits, 4) + " " +
          PApplet.nfs(m32, digits, 4) + " " +
          PApplet.nfs(m33, digits, 4));
origin: ajavamind/Processing-Cardboard

System.out.println(PApplet.nfs(m00, digits, 4) + " " +
          PApplet.nfs(m01, digits, 4) + " " +
          PApplet.nfs(m02, digits, 4) + " " +
          PApplet.nfs(m03, digits, 4));
System.out.println(PApplet.nfs(m10, digits, 4) + " " +
          PApplet.nfs(m11, digits, 4) + " " +
          PApplet.nfs(m12, digits, 4) + " " +
          PApplet.nfs(m13, digits, 4));
System.out.println(PApplet.nfs(m20, digits, 4) + " " +
          PApplet.nfs(m21, digits, 4) + " " +
          PApplet.nfs(m22, digits, 4) + " " +
          PApplet.nfs(m23, digits, 4));
System.out.println(PApplet.nfs(m30, digits, 4) + " " +
          PApplet.nfs(m31, digits, 4) + " " +
          PApplet.nfs(m32, digits, 4) + " " +
          PApplet.nfs(m33, digits, 4));
processing.corePAppletnfs

Javadoc

number format signed (or space) Formats a number but leaves a blank space in the front when it's positive so that it can be properly aligned with numbers that have a negative sign in front of them.

Popular methods of PApplet

  • constrain
  • createGraphics
    Create an offscreen graphics surface for drawing, in this case for a renderer that writes to a file
  • loadStrings
    ( begin auto-generated from loadStrings.xml ) Reads the contents of a file or url and creates a Stri
  • saveStrings
    ( begin auto-generated from saveStrings.xml ) Writes an array of strings to a file, one line per str
  • abs
  • createImage
    ( begin auto-generated from createImage.xml ) Creates a new PImage (the datatype for storing images)
  • createShape
  • createWriter
    ( begin auto-generated from createWriter.xml ) Creates a new file in the sketch folder, and a PrintW
  • loadImage
  • main
    main() method for running this class from the command line. Usage: PApplet [options] [s
  • max
  • parseInt
  • max,
  • parseInt,
  • random,
  • round,
  • split,
  • sqrt,
  • unhex,
  • arrayCopy,
  • ceil,
  • checkExtension

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now