Parameters
- withUnit
- Specifies whether the unit will be included in the result text.
Return Value
Returns a string that represents the value of this property.
MassProperty mass = new MassProperty(23.40258, Unit.Kilogram); Console.WriteLine($"Without unit: {mass.ToString(false)}"); Console.WriteLine($"with a unit: {mass.ToString(true)}"); // Result: // Without unit: 23,4 // with a unit: 23,4 kg