Skip to content

Commit e380e46

Browse files
committed
Expose ToString() overload in WinRT for FeetInches, StonePounds
1 parent 3c07142 commit e380e46

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

UnitsNet/CustomCode/UnitClasses/Length.extra.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
using JetBrains.Annotations;
2424
using UnitsNet.Units;
2525

26+
#if WINDOWS_UWP
27+
using Culture=System.String;
28+
#else
29+
using Culture=System.IFormatProvider;
30+
#endif
31+
2632
namespace UnitsNet
2733
{
2834
/// <summary>
@@ -126,12 +132,7 @@ public override string ToString()
126132
return ToString(null);
127133
}
128134

129-
#if WINDOWS_UWP
130-
internal
131-
#else
132-
public
133-
#endif
134-
string ToString([CanBeNull] IFormatProvider cultureInfo)
135+
public string ToString([CanBeNull] Culture cultureInfo)
135136
{
136137
// Note that it isn't customary to use fractions - one wouldn't say "I am 5 feet and 4.5 inches".
137138
// So inches are rounded when converting from base units to feet/inches.

UnitsNet/CustomCode/UnitClasses/Mass.extra.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
using JetBrains.Annotations;
2424
using UnitsNet.Units;
2525

26+
#if WINDOWS_UWP
27+
using Culture = System.String;
28+
#else
29+
using Culture = System.IFormatProvider;
30+
#endif
31+
2632
namespace UnitsNet
2733
{
2834
#if WINDOWS_UWP
@@ -110,12 +116,7 @@ public override string ToString()
110116
return ToString(null);
111117
}
112118

113-
#if WINDOWS_UWP
114-
internal
115-
#else
116-
public
117-
#endif
118-
string ToString([CanBeNull] IFormatProvider cultureInfo)
119+
public string ToString([CanBeNull] Culture cultureInfo)
119120
{
120121
// Note that it isn't customary to use fractions - one wouldn't say "I am 11 stone and 4.5 pounds".
121122
// So pounds are rounded here.

0 commit comments

Comments
 (0)