Class DoubleConverter

java.lang.Object
org.jfree.svg.util.DoubleConverter
All Implemented Interfaces:
DoubleFunction<String>

public class DoubleConverter extends Object implements DoubleFunction<String>
A function that converts double values to a string representation with a maximum number of decimal places.
  • Field Details

  • Constructor Details

    • DoubleConverter

      public DoubleConverter(int dp)
      Creates a new function that converts double values to strings with the maximum number of decimal places as specified.
      Parameters:
      dp - the max decimal places (in the range 1 to 10).
  • Method Details

    • apply

      public String apply(double value)
      Returns a string representation of the specified value.
      Specified by:
      apply in interface DoubleFunction<String>
      Parameters:
      value - the value.
      Returns:
      A string representation of the specified value.