MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / getDigits

Method getDigits

ij/src/main/java/ij/gui/Plot.java:3194–3200  ·  view source on GitHub ↗

Returns the number of digits to display the number n with resolution 'resolution'; (if n is integer and small enough to display without scientific notation, no decimals are needed, irrespective of 'resolution') Scientific notation is used for more than 'maxDigits' (must be >=3), and indicated by

(double n, double resolution, int maxDigits, int suggestedDigits)

Source from the content-addressed store, hash-verified

3192 * Returns 'suggestedDigits' if not 0 and compatible with the resolution; negative values of
3193 * 'suggestedDigits' switch to scientific notation. */
3194 @AstroImageJ(reason = "Access widen for Vector Plot saving", modified = true)
3195 public static int getDigits(double n, double resolution, int maxDigits, int suggestedDigits) {
3196 if (n==Math.round(n) && Math.abs(n) < Math.pow(10,maxDigits-1)-1) //integers and not too big
3197 return suggestedDigits;
3198 else
3199 return getDigits2(n, resolution, maxDigits, suggestedDigits);
3200 }
3201
3202 /** Number of digits to display the range between n1 and n2 with resolution 'resolution';
3203 * Scientific notation is used for more than 'maxDigits' (must be >=3), and indicated

Callers 6

setupDialogMethod · 0.95
recordMethod · 0.95
getCoordinatesMethod · 0.95
getPrecisionMethod · 0.95

Calls 4

getDigits2Method · 0.95
roundMethod · 0.45
absMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected