Class Mm


public class Mm extends Units
CSS mm (millimeter) unit value.

The mm unit is an absolute-length unit equal to one millimeter. In CSS, 1mm equals 1/10th of a centimeter or approximately 3.78px. Millimeters are primarily useful for print stylesheets where precise physical measurements are needed.

Usage:


 Units size = new Mm(50);
 element.setWidth(new Mm(210));  // A4 width
 element.setBorderWidth(new Mm(1));
 
Since:
2016
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • Mm

      public Mm(float value)
      Constructs an Mm unit with the specified value.
      Parameters:
      value - the millimeter value
  • Method Details

    • sizeToString

      public String sizeToString()
      Returns the CSS string representation of this mm value.
      Specified by:
      sizeToString in class Units
      Returns:
      the CSS value string (e.g., "50mm")