Skip to content

Commit 5e52d4d

Browse files
Use MessageFormatUtil for float toString conversion in UnitValue class
1 parent d970456 commit 5e52d4d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

layout/src/main/java/com/itextpdf/layout/property/UnitValue.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ This file is part of the iText (R) project.
4343
*/
4444
package com.itextpdf.layout.property;
4545

46+
import com.itextpdf.io.util.MessageFormatUtil;
47+
4648
/**
4749
* A specialized class that holds a value and the unit it is measured in.
4850
*/
@@ -186,6 +188,6 @@ public int hashCode() {
186188

187189
@Override
188190
public String toString() {
189-
return value + (unitType == PERCENT ? "%" : "pt");
191+
return MessageFormatUtil.format((unitType == PERCENT ? "{0}%" : "{0}pt"), value);
190192
}
191193
}

0 commit comments

Comments
 (0)