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)
| 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 |
no test coverage detected