Skip to content

Commit 9127760

Browse files
Use MessageFormatUtil for float toString conversion in UnitValue class
Autoported commit. Original commit hash: [5e52d4dc12]
1 parent d37b357 commit 9127760

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

itext/itext.layout/itext/layout/properties/UnitValue.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ source product.
4242
4343
*/
4444
using System;
45+
using iText.IO.Util;
4546

4647
namespace iText.Layout.Properties {
4748
/// <summary>A specialized class that holds a value and the unit it is measured in.</summary>
@@ -198,7 +199,7 @@ public override int GetHashCode() {
198199
}
199200

200201
public override String ToString() {
201-
return value + (unitType == PERCENT ? "%" : "pt");
202+
return MessageFormatUtil.Format((unitType == PERCENT ? "{0}%" : "{0}pt"), value);
202203
}
203204
}
204205
}

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d9704561100ec2161f9b77dcc7f85170b6ac81b6
1+
5e52d4dc121eaca3d41608c7bcf4b4901475fc5f

0 commit comments

Comments
 (0)