Skip to content

Commit c004773

Browse files
committed
codegen: Use Unit in ToString()
1 parent 1a73c5f commit c004773

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,7 @@ namespace UnitsNet
633633
634634
#endregion
635635
636+
[Obsolete("This should no longer be used. ToString() uses the unit this quantity value was constructed with as default. Pass argument BaseUnit to preserve old behavior.")]
636637
/// <summary>
637638
/// Set the default unit used by ToString(). Default is $baseUnitSingularName
638639
/// </summary>
@@ -644,7 +645,7 @@ namespace UnitsNet
644645
/// <returns>String representation.</returns>
645646
public override string ToString()
646647
{
647-
return ToString(ToStringDefaultUnit);
648+
return ToString(Unit);
648649
}
649650
650651
/// <summary>

0 commit comments

Comments
 (0)