From 845639ef7cad84da6fd54e8d3fb85b39c3dba682 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Mon, 4 Feb 2019 10:36:26 -0500 Subject: [PATCH 01/21] Initial implementation of IFormattable --- UnitsNet.Tests/QuantityIFormattableTests.cs | 57 +++++++++++++++++ UnitsNet.Tests/QuantityTests.ToString.cs | 3 +- .../Acceleration.WindowsRuntimeComponent.g.cs | 2 +- ...ntOfSubstance.WindowsRuntimeComponent.g.cs | 2 +- ...mplitudeRatio.WindowsRuntimeComponent.g.cs | 2 +- .../Angle.WindowsRuntimeComponent.g.cs | 2 +- ...pparentEnergy.WindowsRuntimeComponent.g.cs | 2 +- ...ApparentPower.WindowsRuntimeComponent.g.cs | 2 +- .../Area.WindowsRuntimeComponent.g.cs | 2 +- .../AreaDensity.WindowsRuntimeComponent.g.cs | 2 +- ...mentOfInertia.WindowsRuntimeComponent.g.cs | 2 +- .../BitRate.WindowsRuntimeComponent.g.cs | 2 +- ...elConsumption.WindowsRuntimeComponent.g.cs | 2 +- .../Capacitance.WindowsRuntimeComponent.g.cs | 2 +- ...rmalExpansion.WindowsRuntimeComponent.g.cs | 2 +- .../Density.WindowsRuntimeComponent.g.cs | 2 +- .../Duration.WindowsRuntimeComponent.g.cs | 2 +- ...amicViscosity.WindowsRuntimeComponent.g.cs | 2 +- ...ricAdmittance.WindowsRuntimeComponent.g.cs | 2 +- ...lectricCharge.WindowsRuntimeComponent.g.cs | 2 +- ...ChargeDensity.WindowsRuntimeComponent.g.cs | 2 +- ...icConductance.WindowsRuntimeComponent.g.cs | 2 +- ...cConductivity.WindowsRuntimeComponent.g.cs | 2 +- ...ectricCurrent.WindowsRuntimeComponent.g.cs | 2 +- ...urrentDensity.WindowsRuntimeComponent.g.cs | 2 +- ...rrentGradient.WindowsRuntimeComponent.g.cs | 2 +- ...ElectricField.WindowsRuntimeComponent.g.cs | 2 +- ...ricInductance.WindowsRuntimeComponent.g.cs | 2 +- ...tricPotential.WindowsRuntimeComponent.g.cs | 2 +- ...icPotentialAc.WindowsRuntimeComponent.g.cs | 2 +- ...icPotentialDc.WindowsRuntimeComponent.g.cs | 2 +- ...ricResistance.WindowsRuntimeComponent.g.cs | 2 +- ...icResistivity.WindowsRuntimeComponent.g.cs | 2 +- .../Energy.WindowsRuntimeComponent.g.cs | 2 +- .../Entropy.WindowsRuntimeComponent.g.cs | 2 +- .../Force.WindowsRuntimeComponent.g.cs | 2 +- ...rceChangeRate.WindowsRuntimeComponent.g.cs | 2 +- ...orcePerLength.WindowsRuntimeComponent.g.cs | 2 +- .../Frequency.WindowsRuntimeComponent.g.cs | 2 +- .../HeatFlux.WindowsRuntimeComponent.g.cs | 2 +- ...erCoefficient.WindowsRuntimeComponent.g.cs | 2 +- .../Illuminance.WindowsRuntimeComponent.g.cs | 2 +- .../Information.WindowsRuntimeComponent.g.cs | 2 +- .../Irradiance.WindowsRuntimeComponent.g.cs | 2 +- .../Irradiation.WindowsRuntimeComponent.g.cs | 2 +- ...aticViscosity.WindowsRuntimeComponent.g.cs | 2 +- .../LapseRate.WindowsRuntimeComponent.g.cs | 2 +- .../Length.WindowsRuntimeComponent.g.cs | 2 +- .../Level.WindowsRuntimeComponent.g.cs | 2 +- ...LinearDensity.WindowsRuntimeComponent.g.cs | 2 +- .../LuminousFlux.WindowsRuntimeComponent.g.cs | 2 +- ...nousIntensity.WindowsRuntimeComponent.g.cs | 2 +- ...MagneticField.WindowsRuntimeComponent.g.cs | 2 +- .../MagneticFlux.WindowsRuntimeComponent.g.cs | 2 +- ...Magnetization.WindowsRuntimeComponent.g.cs | 2 +- .../Mass.WindowsRuntimeComponent.g.cs | 2 +- .../MassFlow.WindowsRuntimeComponent.g.cs | 2 +- .../MassFlux.WindowsRuntimeComponent.g.cs | 2 +- ...mentOfInertia.WindowsRuntimeComponent.g.cs | 2 +- .../MolarEnergy.WindowsRuntimeComponent.g.cs | 2 +- .../MolarEntropy.WindowsRuntimeComponent.g.cs | 2 +- .../MolarMass.WindowsRuntimeComponent.g.cs | 2 +- .../Molarity.WindowsRuntimeComponent.g.cs | 2 +- .../Permeability.WindowsRuntimeComponent.g.cs | 2 +- .../Permittivity.WindowsRuntimeComponent.g.cs | 2 +- .../Power.WindowsRuntimeComponent.g.cs | 2 +- .../PowerDensity.WindowsRuntimeComponent.g.cs | 2 +- .../PowerRatio.WindowsRuntimeComponent.g.cs | 2 +- .../Pressure.WindowsRuntimeComponent.g.cs | 2 +- ...ureChangeRate.WindowsRuntimeComponent.g.cs | 2 +- .../Ratio.WindowsRuntimeComponent.g.cs | 2 +- ...eactiveEnergy.WindowsRuntimeComponent.g.cs | 2 +- ...ReactivePower.WindowsRuntimeComponent.g.cs | 2 +- ...lAcceleration.WindowsRuntimeComponent.g.cs | 2 +- ...tationalSpeed.WindowsRuntimeComponent.g.cs | 2 +- ...onalStiffness.WindowsRuntimeComponent.g.cs | 2 +- ...nessPerLength.WindowsRuntimeComponent.g.cs | 2 +- .../SolidAngle.WindowsRuntimeComponent.g.cs | 2 +- ...pecificEnergy.WindowsRuntimeComponent.g.cs | 2 +- ...ecificEntropy.WindowsRuntimeComponent.g.cs | 2 +- ...pecificVolume.WindowsRuntimeComponent.g.cs | 2 +- ...pecificWeight.WindowsRuntimeComponent.g.cs | 2 +- .../Speed.WindowsRuntimeComponent.g.cs | 2 +- .../Temperature.WindowsRuntimeComponent.g.cs | 2 +- ...ureChangeRate.WindowsRuntimeComponent.g.cs | 2 +- ...peratureDelta.WindowsRuntimeComponent.g.cs | 2 +- ...lConductivity.WindowsRuntimeComponent.g.cs | 2 +- ...malResistance.WindowsRuntimeComponent.g.cs | 2 +- .../Torque.WindowsRuntimeComponent.g.cs | 2 +- .../VitaminA.WindowsRuntimeComponent.g.cs | 2 +- .../Volume.WindowsRuntimeComponent.g.cs | 2 +- .../VolumeFlow.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Acceleration.NetFramework.g.cs | 58 +++++++++++++++++- .../AmountOfSubstance.NetFramework.g.cs | 58 +++++++++++++++++- .../AmplitudeRatio.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Angle.NetFramework.g.cs | 58 +++++++++++++++++- .../ApparentEnergy.NetFramework.g.cs | 58 +++++++++++++++++- .../ApparentPower.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Area.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/AreaDensity.NetFramework.g.cs | 58 +++++++++++++++++- .../AreaMomentOfInertia.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/BitRate.NetFramework.g.cs | 58 +++++++++++++++++- ...eSpecificFuelConsumption.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Capacitance.NetFramework.g.cs | 58 +++++++++++++++++- ...icientOfThermalExpansion.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Density.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Duration.NetFramework.g.cs | 58 +++++++++++++++++- .../DynamicViscosity.NetFramework.g.cs | 58 +++++++++++++++++- .../ElectricAdmittance.NetFramework.g.cs | 58 +++++++++++++++++- .../ElectricCharge.NetFramework.g.cs | 58 +++++++++++++++++- .../ElectricChargeDensity.NetFramework.g.cs | 58 +++++++++++++++++- .../ElectricConductance.NetFramework.g.cs | 58 +++++++++++++++++- .../ElectricConductivity.NetFramework.g.cs | 58 +++++++++++++++++- .../ElectricCurrent.NetFramework.g.cs | 58 +++++++++++++++++- .../ElectricCurrentDensity.NetFramework.g.cs | 58 +++++++++++++++++- .../ElectricCurrentGradient.NetFramework.g.cs | 58 +++++++++++++++++- .../ElectricField.NetFramework.g.cs | 58 +++++++++++++++++- .../ElectricInductance.NetFramework.g.cs | 58 +++++++++++++++++- .../ElectricPotential.NetFramework.g.cs | 58 +++++++++++++++++- .../ElectricPotentialAc.NetFramework.g.cs | 58 +++++++++++++++++- .../ElectricPotentialDc.NetFramework.g.cs | 58 +++++++++++++++++- .../ElectricResistance.NetFramework.g.cs | 58 +++++++++++++++++- .../ElectricResistivity.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Energy.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Entropy.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Force.NetFramework.g.cs | 58 +++++++++++++++++- .../ForceChangeRate.NetFramework.g.cs | 58 +++++++++++++++++- .../ForcePerLength.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Frequency.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/HeatFlux.NetFramework.g.cs | 58 +++++++++++++++++- .../HeatTransferCoefficient.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Illuminance.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Information.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Irradiance.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Irradiation.NetFramework.g.cs | 58 +++++++++++++++++- .../KinematicViscosity.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/LapseRate.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Length.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Level.NetFramework.g.cs | 58 +++++++++++++++++- .../LinearDensity.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/LuminousFlux.NetFramework.g.cs | 58 +++++++++++++++++- .../LuminousIntensity.NetFramework.g.cs | 58 +++++++++++++++++- .../MagneticField.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/MagneticFlux.NetFramework.g.cs | 58 +++++++++++++++++- .../Magnetization.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Mass.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/MassFlow.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/MassFlux.NetFramework.g.cs | 58 +++++++++++++++++- .../MassMomentOfInertia.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/MolarEnergy.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/MolarEntropy.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/MolarMass.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Molarity.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Permeability.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Permittivity.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Power.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/PowerDensity.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/PowerRatio.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Pressure.NetFramework.g.cs | 58 +++++++++++++++++- .../PressureChangeRate.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Ratio.NetFramework.g.cs | 58 +++++++++++++++++- .../ReactiveEnergy.NetFramework.g.cs | 58 +++++++++++++++++- .../ReactivePower.NetFramework.g.cs | 58 +++++++++++++++++- .../RotationalAcceleration.NetFramework.g.cs | 58 +++++++++++++++++- .../RotationalSpeed.NetFramework.g.cs | 58 +++++++++++++++++- .../RotationalStiffness.NetFramework.g.cs | 58 +++++++++++++++++- ...tionalStiffnessPerLength.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/SolidAngle.NetFramework.g.cs | 58 +++++++++++++++++- .../SpecificEnergy.NetFramework.g.cs | 58 +++++++++++++++++- .../SpecificEntropy.NetFramework.g.cs | 58 +++++++++++++++++- .../SpecificVolume.NetFramework.g.cs | 58 +++++++++++++++++- .../SpecificWeight.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Speed.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Temperature.NetFramework.g.cs | 58 +++++++++++++++++- .../TemperatureChangeRate.NetFramework.g.cs | 58 +++++++++++++++++- .../TemperatureDelta.NetFramework.g.cs | 58 +++++++++++++++++- .../ThermalConductivity.NetFramework.g.cs | 58 +++++++++++++++++- .../ThermalResistance.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Torque.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/VitaminA.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/Volume.NetFramework.g.cs | 58 +++++++++++++++++- .../Quantities/VolumeFlow.NetFramework.g.cs | 58 +++++++++++++++++- .../Include-GenerateQuantitySourceCode.ps1 | 61 ++++++++++++++++++- 183 files changed, 5248 insertions(+), 273 deletions(-) create mode 100644 UnitsNet.Tests/QuantityIFormattableTests.cs diff --git a/UnitsNet.Tests/QuantityIFormattableTests.cs b/UnitsNet.Tests/QuantityIFormattableTests.cs new file mode 100644 index 0000000000..265637536f --- /dev/null +++ b/UnitsNet.Tests/QuantityIFormattableTests.cs @@ -0,0 +1,57 @@ +using UnitsNet.Units; +using Xunit; + +namespace UnitsNet.Tests +{ + public class QuantityIFormattableTests + { + private static Length length = Length.FromFeet(3.0); + + [Fact] + public void GFormatStringEqualsToString() + { + Assert.Equal(length.ToString("G"), length.ToString()); + } + + [Fact] + public void EmptyOrNullFormatStringEqualsGFormat() + { + Assert.Equal(length.ToString("G"), length.ToString(string.Empty)); + Assert.Equal(length.ToString("G"), length.ToString((string)null)); + Assert.Equal(length.ToString("G"), length.ToString(" ")); + } + + [Fact] + public void AFormatGetsAbbreviations() + { + Assert.Equal(UnitAbbreviationsCache.Default.GetDefaultAbbreviation(length.Unit), length.ToString("A")); + Assert.Equal(UnitAbbreviationsCache.Default.GetDefaultAbbreviation(length.Unit), length.ToString("A0")); + + Assert.Equal(UnitAbbreviationsCache.Default.GetUnitAbbreviations(length.Unit)[1], length.ToString("A1")); + Assert.Equal(UnitAbbreviationsCache.Default.GetUnitAbbreviations(length.Unit)[2], length.ToString("A2")); + } + + [Fact] + public void VFormatEqualsValueToString() + { + Assert.Equal(length.Value.ToString(), length.ToString("V")); + } + + [Fact] + public void QFormatEqualsQuantityName() + { + Assert.Equal(Length.Info.Name, length.ToString("Q")); + } + + [Fact] + public void SFormatEqualsSignificantDigits() + { + Assert.Equal(length.ToString(null, 1), length.ToString("S")); + Assert.Equal(length.ToString(null, 1), length.ToString("S1")); + Assert.Equal(length.ToString(null, 2), length.ToString("S2")); + Assert.Equal(length.ToString(null, 3), length.ToString("S3")); + Assert.Equal(length.ToString(null, 4), length.ToString("S4")); + Assert.Equal(length.ToString(null, 5), length.ToString("S5")); + } + } +} diff --git a/UnitsNet.Tests/QuantityTests.ToString.cs b/UnitsNet.Tests/QuantityTests.ToString.cs index 0c6c21e935..537c72ed59 100644 --- a/UnitsNet.Tests/QuantityTests.ToString.cs +++ b/UnitsNet.Tests/QuantityTests.ToString.cs @@ -19,6 +19,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +using System; using System.Globalization; using UnitsNet.Units; using Xunit; @@ -124,7 +125,7 @@ public void FormatsNumberUsingGivenCulture() try { GlobalConfiguration.DefaultCulture = CultureInfo.InvariantCulture; - Assert.Equal("0.05 m", Length.FromCentimeters(5).ToUnit(LengthUnit.Meter).ToString(null)); + Assert.Equal("0.05 m", Length.FromCentimeters(5).ToUnit(LengthUnit.Meter).ToString((IFormatProvider)null)); Assert.Equal("0.05 m", Length.FromCentimeters(5).ToUnit(LengthUnit.Meter).ToString(CultureInfo.InvariantCulture)); Assert.Equal("0,05 m", Length.FromCentimeters(5).ToUnit(LengthUnit.Meter).ToString(new CultureInfo("nb-NO"))); } diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs index 0b48b82a64..c86a68a818 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs @@ -741,7 +741,7 @@ private double AsBaseNumericType(AccelerationUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs index eb9aa4a03a..e8247e26e2 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs @@ -775,7 +775,7 @@ private double AsBaseNumericType(AmountOfSubstanceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs index 4396eb6ed2..dba0ff3901 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs @@ -588,7 +588,7 @@ private double AsBaseNumericType(AmplitudeRatioUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs index 2a5fede07e..91682c32cf 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs @@ -758,7 +758,7 @@ private double AsBaseNumericType(AngleUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs index 0a663cc9c7..9c4527b71b 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs @@ -571,7 +571,7 @@ private double AsBaseNumericType(ApparentEnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs index 5b2fd06362..488ce3573a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs @@ -588,7 +588,7 @@ private double AsBaseNumericType(ApparentPowerUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs index 01d9877599..44cd28d65e 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs @@ -741,7 +741,7 @@ private double AsBaseNumericType(AreaUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs index 72377de386..7c96b25aa7 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs @@ -537,7 +537,7 @@ private double AsBaseNumericType(AreaDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs index 7cc39c406e..94bc11c307 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs @@ -622,7 +622,7 @@ private double AsBaseNumericType(AreaMomentOfInertiaUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs index 9e067b1b77..f6b2754313 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs @@ -965,7 +965,7 @@ private decimal AsBaseNumericType(BitRateUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs index 09376e7a3f..59d7dcb3e4 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs @@ -571,7 +571,7 @@ private double AsBaseNumericType(BrakeSpecificFuelConsumptionUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs index 19350ebd21..4f31bc4de9 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs @@ -642,7 +642,7 @@ private double AsBaseNumericType(CapacitanceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/CoefficientOfThermalExpansion.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/CoefficientOfThermalExpansion.WindowsRuntimeComponent.g.cs index 1fbb4153a8..f26b03ad1e 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/CoefficientOfThermalExpansion.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/CoefficientOfThermalExpansion.WindowsRuntimeComponent.g.cs @@ -571,7 +571,7 @@ private double AsBaseNumericType(CoefficientOfThermalExpansionUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs index 8ba926ec29..f86cece798 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs @@ -1186,7 +1186,7 @@ private double AsBaseNumericType(DensityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs index eb5bad33ee..2d0e6dffae 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs @@ -690,7 +690,7 @@ private double AsBaseNumericType(DurationUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs index 5b89ed3274..bd11b5018d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs @@ -625,7 +625,7 @@ private double AsBaseNumericType(DynamicViscosityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs index af5658697e..e7f9f76475 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs @@ -588,7 +588,7 @@ private double AsBaseNumericType(ElectricAdmittanceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs index 3f7522be08..307ae75764 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs @@ -540,7 +540,7 @@ private double AsBaseNumericType(ElectricChargeUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs index 677e7b5793..55d38cd7b9 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs @@ -540,7 +540,7 @@ private double AsBaseNumericType(ElectricChargeDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs index 393f74ca49..7c50ba9319 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs @@ -574,7 +574,7 @@ private double AsBaseNumericType(ElectricConductanceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs index 6a81fc4ff6..48be7aec2c 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs @@ -540,7 +540,7 @@ private double AsBaseNumericType(ElectricConductivityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs index 83f4fae91b..f7f247c542 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs @@ -656,7 +656,7 @@ private double AsBaseNumericType(ElectricCurrentUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs index 277d4171ea..2fb40d7833 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs @@ -540,7 +540,7 @@ private double AsBaseNumericType(ElectricCurrentDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs index 35a55382d1..9419bb3ee8 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs @@ -537,7 +537,7 @@ private double AsBaseNumericType(ElectricCurrentGradientUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs index 4db1c0c461..46a8a7cd06 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs @@ -540,7 +540,7 @@ private double AsBaseNumericType(ElectricFieldUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs index b8cefc2351..6a251b1161 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs @@ -591,7 +591,7 @@ private double AsBaseNumericType(ElectricInductanceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs index 0412078540..beaa4dec97 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs @@ -605,7 +605,7 @@ private double AsBaseNumericType(ElectricPotentialUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs index f901f1a3b6..860866f496 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs @@ -605,7 +605,7 @@ private double AsBaseNumericType(ElectricPotentialAcUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs index ec8d625a26..f1765bf32a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs @@ -605,7 +605,7 @@ private double AsBaseNumericType(ElectricPotentialDcUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs index 1c965c6e3a..a9c7661aad 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs @@ -605,7 +605,7 @@ private double AsBaseNumericType(ElectricResistanceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs index b69f75ca5c..e6e30b8cba 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs @@ -761,7 +761,7 @@ private double AsBaseNumericType(ElectricResistivityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs index 852a460b2c..f72d7909a7 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs @@ -894,7 +894,7 @@ private double AsBaseNumericType(EnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs index 4fd99c5cf8..cf34774d55 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs @@ -639,7 +639,7 @@ private double AsBaseNumericType(EntropyUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs index 4773b8cd0c..39bd08b95c 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs @@ -741,7 +741,7 @@ private double AsBaseNumericType(ForceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs index 2cc261c606..29846f1fb7 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs @@ -707,7 +707,7 @@ private double AsBaseNumericType(ForceChangeRateUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs index 7bebb1665d..b854767574 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs @@ -673,7 +673,7 @@ private double AsBaseNumericType(ForcePerLengthUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs index 16ca9af971..3d6b32b576 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs @@ -656,7 +656,7 @@ private double AsBaseNumericType(FrequencyUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs index 7e640396ee..6e03604bfe 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs @@ -826,7 +826,7 @@ private double AsBaseNumericType(HeatFluxUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs index c1ca7f2a0c..2a8a5b6810 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs @@ -554,7 +554,7 @@ private double AsBaseNumericType(HeatTransferCoefficientUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs index 44efaf6512..713a3ad0c1 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs @@ -591,7 +591,7 @@ private double AsBaseNumericType(IlluminanceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs index 3c7d98c725..113c139e7a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs @@ -962,7 +962,7 @@ private decimal AsBaseNumericType(InformationUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs index 2f290af815..15461c3612 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs @@ -758,7 +758,7 @@ private double AsBaseNumericType(IrradianceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs index 166bfbc21f..adcc716df9 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs @@ -591,7 +591,7 @@ private double AsBaseNumericType(IrradiationUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs index e153941180..89ddf32fe7 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs @@ -659,7 +659,7 @@ private double AsBaseNumericType(KinematicViscosityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs index 64078ae75f..9d8af77c97 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs @@ -537,7 +537,7 @@ private double AsBaseNumericType(LapseRateUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs index ef1a78d95e..b73666875a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs @@ -894,7 +894,7 @@ private double AsBaseNumericType(LengthUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs index fa5c031591..6abd7b2b88 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs @@ -554,7 +554,7 @@ private double AsBaseNumericType(LevelUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs index eb637e4b78..8e3bc8a44d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs @@ -574,7 +574,7 @@ private double AsBaseNumericType(LinearDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs index 8257d8eb6b..f676703d33 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs @@ -540,7 +540,7 @@ private double AsBaseNumericType(LuminousFluxUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs index 18bae845cb..80c63a522d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs @@ -540,7 +540,7 @@ private double AsBaseNumericType(LuminousIntensityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs index ea3b10d430..83f9d6a031 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs @@ -591,7 +591,7 @@ private double AsBaseNumericType(MagneticFieldUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs index 22743be9fb..d62ce78fa2 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs @@ -540,7 +540,7 @@ private double AsBaseNumericType(MagneticFluxUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs index b85d884124..1d93d28daa 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs @@ -540,7 +540,7 @@ private double AsBaseNumericType(MagnetizationUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs index 80a859b5ee..7365af9e3a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs @@ -911,7 +911,7 @@ private double AsBaseNumericType(MassUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs index 4b87aef143..ae3b157793 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs @@ -1047,7 +1047,7 @@ private double AsBaseNumericType(MassFlowUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs index a2fb3037f9..724a7471e4 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs @@ -554,7 +554,7 @@ private double AsBaseNumericType(MassFluxUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs index 7decc8e3d7..99523c269f 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs @@ -996,7 +996,7 @@ private double AsBaseNumericType(MassMomentOfInertiaUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs index ee197564ca..91aa6be06d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs @@ -571,7 +571,7 @@ private double AsBaseNumericType(MolarEnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs index 134825c7dc..5755dfaa2e 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs @@ -571,7 +571,7 @@ private double AsBaseNumericType(MolarEntropyUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs index 69026880c9..7c5d730b2d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs @@ -724,7 +724,7 @@ private double AsBaseNumericType(MolarMassUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs index a039ebcbb6..a78cdfc447 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs @@ -659,7 +659,7 @@ private double AsBaseNumericType(MolarityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs index d26f45e3e6..ee6a5e82d8 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs @@ -540,7 +540,7 @@ private double AsBaseNumericType(PermeabilityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs index d88072a559..2d2a3bb9b1 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs @@ -540,7 +540,7 @@ private double AsBaseNumericType(PermittivityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs index 76dba7d04c..7842e3fbd8 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs @@ -860,7 +860,7 @@ private decimal AsBaseNumericType(PowerUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs index c2640cd503..48568db4e7 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs @@ -1268,7 +1268,7 @@ private double AsBaseNumericType(PowerDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs index 5a30339e20..e1945b051b 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs @@ -554,7 +554,7 @@ private double AsBaseNumericType(PowerRatioUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs index 84585b4ed7..b6f5342ca1 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs @@ -1234,7 +1234,7 @@ private double AsBaseNumericType(PressureUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs index 91e75ee189..93f5f6b0d3 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs @@ -639,7 +639,7 @@ private double AsBaseNumericType(PressureChangeRateUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs index 77e7cea74e..0fb21696f9 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs @@ -622,7 +622,7 @@ private double AsBaseNumericType(RatioUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs index 7896f79761..0c09fea58b 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs @@ -571,7 +571,7 @@ private double AsBaseNumericType(ReactiveEnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs index 5162418ae7..36d4401cfe 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs @@ -588,7 +588,7 @@ private double AsBaseNumericType(ReactivePowerUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs index 021bd61e94..1b0309186b 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs @@ -571,7 +571,7 @@ private double AsBaseNumericType(RotationalAccelerationUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs index c33960d549..d8aac2132e 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs @@ -741,7 +741,7 @@ private double AsBaseNumericType(RotationalSpeedUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs index e400d96e5a..9873fa5592 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs @@ -571,7 +571,7 @@ private double AsBaseNumericType(RotationalStiffnessUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs index e7529cbe73..5560dfdcf8 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs @@ -571,7 +571,7 @@ private double AsBaseNumericType(RotationalStiffnessPerLengthUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs index fd58f9f553..cf97490156 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs @@ -540,7 +540,7 @@ private double AsBaseNumericType(SolidAngleUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs index c5226d4c0a..4f684d7a94 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs @@ -676,7 +676,7 @@ private double AsBaseNumericType(SpecificEnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs index cb3d8e99f5..8b18e0ef86 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs @@ -656,7 +656,7 @@ private double AsBaseNumericType(SpecificEntropyUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs index 5f2eb15de4..608a9e39f5 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs @@ -571,7 +571,7 @@ private double AsBaseNumericType(SpecificVolumeUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs index 6286f64b06..a43def6e4d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs @@ -812,7 +812,7 @@ private double AsBaseNumericType(SpecificWeightUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs index 2e2ce86e8d..2ae6d0f22e 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs @@ -1064,7 +1064,7 @@ private double AsBaseNumericType(SpeedUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs index fd897ebd46..4107f77ee6 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs @@ -656,7 +656,7 @@ private double AsBaseNumericType(TemperatureUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs index 7dcc4b1697..ab3bf3e935 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs @@ -690,7 +690,7 @@ private double AsBaseNumericType(TemperatureChangeRateUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs index 1b411e8fd8..bffab3da07 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs @@ -656,7 +656,7 @@ private double AsBaseNumericType(TemperatureDeltaUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs index 4d62726a59..612a1ca4fb 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs @@ -557,7 +557,7 @@ private double AsBaseNumericType(ThermalConductivityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs index d228c1d3b4..73300fdcc4 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs @@ -605,7 +605,7 @@ private double AsBaseNumericType(ThermalResistanceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs index f5b92a8353..9b0f371073 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs @@ -877,7 +877,7 @@ private double AsBaseNumericType(TorqueUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs index 9180239736..d8cc2572ff 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs @@ -537,7 +537,7 @@ private double AsBaseNumericType(VitaminAUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs index 94301a8c88..75fb3716e5 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs @@ -1285,7 +1285,7 @@ private double AsBaseNumericType(VolumeUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs index 8a54351818..f9e70787df 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs @@ -1336,7 +1336,7 @@ private double AsBaseNumericType(VolumeFlowUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index 08c74e0f64..98d4122d1b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Acceleration, in physics, is the rate at which the velocity of an object changes over time. An object's acceleration is the net result of any and all forces acting on the object, as described by Newton's Second Law. The SI unit for acceleration is the Meter per second squared (m/s²). Accelerations are vector quantities (they have magnitude and direction) and add according to the parallelogram law. As a vector, the calculated net force is equal to the product of the object's mass (a scalar quantity) and the acceleration. /// - public partial struct Acceleration : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Acceleration : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -784,7 +784,7 @@ private double AsBaseNumericType(AccelerationUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -829,6 +829,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index 7c762297c0..50a0925d63 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Mole is the amount of substance containing Avagadro's Number (6.02 x 10 ^ 23) of real particles such as molecules,atoms, ions or radicals. /// - public partial struct AmountOfSubstance : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct AmountOfSubstance : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -816,7 +816,7 @@ private double AsBaseNumericType(AmountOfSubstanceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -861,6 +861,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index 0e5f5e9d8d..a3be5b143d 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The strength of a signal expressed in decibels (dB) relative to one volt RMS. /// - public partial struct AmplitudeRatio : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct AmplitudeRatio : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -648,7 +648,7 @@ private double AsBaseNumericType(AmplitudeRatioUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -693,6 +693,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index 448d1272fc..4816eb0770 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In geometry, an angle is the figure formed by two rays, called the sides of the angle, sharing a common endpoint, called the vertex of the angle. /// - public partial struct Angle : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Angle : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -800,7 +800,7 @@ private double AsBaseNumericType(AngleUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -845,6 +845,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index d392ec317d..56cc6a6e40 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// A unit for expressing the integral of apparent power over time, equal to the product of 1 volt-ampere and 1 hour, or to 3600 joules. /// - public partial struct ApparentEnergy : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ApparentEnergy : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -624,7 +624,7 @@ private double AsBaseNumericType(ApparentEnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -669,6 +669,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index 4df93933c0..0bf9403634 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Power engineers measure apparent power as the magnitude of the vector sum of active and reactive power. Apparent power is the product of the root-mean-square of voltage and current. /// - public partial struct ApparentPower : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ApparentPower : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -640,7 +640,7 @@ private double AsBaseNumericType(ApparentPowerUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -685,6 +685,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index 2be4dfef99..3dddbc295b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Area is a quantity that expresses the extent of a two-dimensional surface or shape, or planar lamina, in the plane. Area can be understood as the amount of material with a given thickness that would be necessary to fashion a model of the shape, or the amount of paint necessary to cover the surface with a single coat.[1] It is the two-dimensional analog of the length of a curve (a one-dimensional concept) or the volume of a solid (a three-dimensional concept). /// - public partial struct Area : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Area : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -784,7 +784,7 @@ private double AsBaseNumericType(AreaUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -829,6 +829,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index 07534ebf43..a14aad11e0 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The area density of a two-dimensional object is calculated as the mass per unit area. /// - public partial struct AreaDensity : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct AreaDensity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -592,7 +592,7 @@ private double AsBaseNumericType(AreaDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -637,6 +637,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index 11e66f8d0b..5af10c411e 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// A geometric property of an area that reflects how its points are distributed with regard to an axis. /// - public partial struct AreaMomentOfInertia : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct AreaMomentOfInertia : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -672,7 +672,7 @@ private double AsBaseNumericType(AreaMomentOfInertiaUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -717,6 +717,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index 07e9bb677b..ed54aaf78f 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Bit_rate /// - public partial struct BitRate : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct BitRate : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -995,7 +995,7 @@ private decimal AsBaseNumericType(BitRateUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -1040,6 +1040,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index 458d573a27..fb3d54e2ea 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Brake specific fuel consumption (BSFC) is a measure of the fuel efficiency of any prime mover that burns fuel and produces rotational, or shaft, power. It is typically used for comparing the efficiency of internal combustion engines with a shaft output. /// - public partial struct BrakeSpecificFuelConsumption : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct BrakeSpecificFuelConsumption : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -624,7 +624,7 @@ private double AsBaseNumericType(BrakeSpecificFuelConsumptionUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -669,6 +669,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index 2fd74cfec4..a294f13834 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Capacitance /// - public partial struct Capacitance : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Capacitance : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -691,7 +691,7 @@ private double AsBaseNumericType(CapacitanceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -736,6 +736,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs index 866a1d2785..c36754ae28 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// A unit that represents a fractional change in size in response to a change in temperature. /// - public partial struct CoefficientOfThermalExpansion : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct CoefficientOfThermalExpansion : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -624,7 +624,7 @@ private double AsBaseNumericType(CoefficientOfThermalExpansionUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -669,6 +669,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index 4f19f6bd90..13d414b726 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// http://en.wikipedia.org/wiki/Density /// - public partial struct Density : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Density : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -1203,7 +1203,7 @@ private double AsBaseNumericType(DensityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -1248,6 +1248,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index 6c6ee09929..b4aee68db6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Time is a dimension in which events can be ordered from the past through the present into the future, and also the measure of durations of events and the intervals between them. /// - public partial struct Duration : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Duration : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -736,7 +736,7 @@ private double AsBaseNumericType(DurationUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -781,6 +781,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index de717c8a67..82d3aa52f9 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Viscosity#Dynamic_.28shear.29_viscosity /// - public partial struct DynamicViscosity : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct DynamicViscosity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -675,7 +675,7 @@ private double AsBaseNumericType(DynamicViscosityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -720,6 +720,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index c3c3f762be..6b53654589 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Electric admittance is a measure of how easily a circuit or device will allow a current to flow. It is defined as the inverse of impedance. The SI unit of admittance is the siemens (symbol S). /// - public partial struct ElectricAdmittance : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ElectricAdmittance : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -640,7 +640,7 @@ private double AsBaseNumericType(ElectricAdmittanceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -685,6 +685,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index 24ad88a94f..ef97d4af6f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Electric_charge /// - public partial struct ElectricCharge : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ElectricCharge : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -595,7 +595,7 @@ private double AsBaseNumericType(ElectricChargeUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -640,6 +640,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index 86ca05b137..62dd626698 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Charge_density /// - public partial struct ElectricChargeDensity : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ElectricChargeDensity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -595,7 +595,7 @@ private double AsBaseNumericType(ElectricChargeDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -640,6 +640,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index 0d43bfac70..f3f12bfe7c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Electrical_resistance_and_conductance /// - public partial struct ElectricConductance : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ElectricConductance : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -627,7 +627,7 @@ private double AsBaseNumericType(ElectricConductanceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -672,6 +672,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index 291cbeb664..d639ced600 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Electrical_resistivity_and_conductivity /// - public partial struct ElectricConductivity : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ElectricConductivity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -595,7 +595,7 @@ private double AsBaseNumericType(ElectricConductivityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -640,6 +640,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index 9855f80955..e6192d9b45 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// An electric current is a flow of electric charge. In electric circuits this charge is often carried by moving electrons in a wire. It can also be carried by ions in an electrolyte, or by both ions and electrons such as in a plasma. /// - public partial struct ElectricCurrent : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ElectricCurrent : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -704,7 +704,7 @@ private double AsBaseNumericType(ElectricCurrentUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -749,6 +749,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index 9fc77b95f5..4204b354d7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Current_density /// - public partial struct ElectricCurrentDensity : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ElectricCurrentDensity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -595,7 +595,7 @@ private double AsBaseNumericType(ElectricCurrentDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -640,6 +640,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index 24f3b659ac..f4f401b77d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In electromagnetism, the current gradient describes how the current changes in time. /// - public partial struct ElectricCurrentGradient : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ElectricCurrentGradient : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -592,7 +592,7 @@ private double AsBaseNumericType(ElectricCurrentGradientUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -637,6 +637,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index a04bf61fef..c22800ec1a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Electric_field /// - public partial struct ElectricField : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ElectricField : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -595,7 +595,7 @@ private double AsBaseNumericType(ElectricFieldUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -640,6 +640,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index b29b667963..9f2b413192 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Inductance /// - public partial struct ElectricInductance : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ElectricInductance : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -643,7 +643,7 @@ private double AsBaseNumericType(ElectricInductanceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -688,6 +688,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index 710a2ea148..8fedb4fd6f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In classical electromagnetism, the electric potential (a scalar quantity denoted by Φ, ΦE or V and also called the electric field potential or the electrostatic potential) at a point is the amount of electric potential energy that a unitary point charge would have when located at that point. /// - public partial struct ElectricPotential : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ElectricPotential : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -656,7 +656,7 @@ private double AsBaseNumericType(ElectricPotentialUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -701,6 +701,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index 5f0224696a..c29943a734 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The Electric Potential of a system known to use Alternating Current. /// - public partial struct ElectricPotentialAc : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ElectricPotentialAc : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -656,7 +656,7 @@ private double AsBaseNumericType(ElectricPotentialAcUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -701,6 +701,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index fb94318231..f12c4517cd 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The Electric Potential of a system known to use Direct Current. /// - public partial struct ElectricPotentialDc : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ElectricPotentialDc : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -656,7 +656,7 @@ private double AsBaseNumericType(ElectricPotentialDcUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -701,6 +701,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index c7b790a1fb..54a7f44c97 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The electrical resistance of an electrical conductor is the opposition to the passage of an electric current through that conductor. /// - public partial struct ElectricResistance : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ElectricResistance : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -656,7 +656,7 @@ private double AsBaseNumericType(ElectricResistanceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -701,6 +701,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index eb69134c5a..9df8ac9ee7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Electrical_resistivity_and_conductivity /// - public partial struct ElectricResistivity : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ElectricResistivity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -803,7 +803,7 @@ private double AsBaseNumericType(ElectricResistivityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -848,6 +848,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index 1c9e13d3d5..978f8571b6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The joule, symbol J, is a derived unit of energy, work, or amount of heat in the International System of Units. It is equal to the energy transferred (or work done) when applying a force of one newton through a distance of one metre (1 newton metre or N·m), or in passing an electric current of one ampere through a resistance of one ohm for one second. Many other units of energy are included. Please do not confuse this definition of the calorie with the one colloquially used by the food industry, the large calorie, which is equivalent to 1 kcal. Thermochemical definition of the calorie is used. For BTU, the IT definition is used. /// - public partial struct Energy : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Energy : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -928,7 +928,7 @@ private double AsBaseNumericType(EnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -973,6 +973,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index a97168aa66..0abcd89542 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Entropy is an important concept in the branch of science known as thermodynamics. The idea of "irreversibility" is central to the understanding of entropy. It is often said that entropy is an expression of the disorder, or randomness of a system, or of our lack of information about it. Entropy is an extensive property. It has the dimension of energy divided by temperature, which has a unit of joules per kelvin (J/K) in the International System of Units /// - public partial struct Entropy : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Entropy : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -688,7 +688,7 @@ private double AsBaseNumericType(EntropyUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -733,6 +733,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index cd94e9f5cb..7502b5d33e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In physics, a force is any influence that causes an object to undergo a certain change, either concerning its movement, direction, or geometrical construction. In other words, a force can cause an object with mass to change its velocity (which includes to begin moving from a state of rest), i.e., to accelerate, or a flexible object to deform, or both. Force can also be described by intuitive concepts such as a push or a pull. A force has both magnitude and direction, making it a vector quantity. It is measured in the SI unit of newtons and represented by the symbol F. /// - public partial struct Force : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Force : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -784,7 +784,7 @@ private double AsBaseNumericType(ForceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -829,6 +829,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index fd74687584..a6457130a0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Force change rate is the ratio of the force change to the time during which the change occurred (value of force changes per unit time). /// - public partial struct ForceChangeRate : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ForceChangeRate : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -752,7 +752,7 @@ private double AsBaseNumericType(ForceChangeRateUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -797,6 +797,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index 8fa64096d2..9e5caf177f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The magnitude of force per unit length. /// - public partial struct ForcePerLength : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ForcePerLength : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -720,7 +720,7 @@ private double AsBaseNumericType(ForcePerLengthUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -765,6 +765,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index d6f2651bca..872141a66d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The number of occurrences of a repeating event per unit time. /// - public partial struct Frequency : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Frequency : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -704,7 +704,7 @@ private double AsBaseNumericType(FrequencyUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -749,6 +749,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index 35a53dd3b2..c84953eadd 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Heat flux is the flow of energy per unit of area per unit of time /// - public partial struct HeatFlux : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct HeatFlux : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -864,7 +864,7 @@ private double AsBaseNumericType(HeatFluxUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -909,6 +909,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index 49f1ef023b..b148103d73 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The heat transfer coefficient or film coefficient, or film effectiveness, in thermodynamics and in mechanics is the proportionality constant between the heat flux and the thermodynamic driving force for the flow of heat (i.e., the temperature difference, ΔT) /// - public partial struct HeatTransferCoefficient : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct HeatTransferCoefficient : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -608,7 +608,7 @@ private double AsBaseNumericType(HeatTransferCoefficientUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -653,6 +653,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index db9d9fcd5d..3a84efc1b3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Illuminance /// - public partial struct Illuminance : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Illuminance : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -643,7 +643,7 @@ private double AsBaseNumericType(IlluminanceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -688,6 +688,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index 051a50ef17..03df390312 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In computing and telecommunications, a unit of information is the capacity of some standard data storage system or communication channel, used to measure the capacities of other systems and channels. In information theory, units of information are also used to measure the information contents or entropy of random variables. /// - public partial struct Information : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Information : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -992,7 +992,7 @@ private decimal AsBaseNumericType(InformationUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -1037,6 +1037,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index 2fd9939174..0e22e4bc97 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Irradiance is the intensity of ultraviolet (UV) or visible light incident on a surface. /// - public partial struct Irradiance : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Irradiance : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -800,7 +800,7 @@ private double AsBaseNumericType(IrradianceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -845,6 +845,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index 13095b9d4f..92e5f9eee5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Irradiation /// - public partial struct Irradiation : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Irradiation : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -643,7 +643,7 @@ private double AsBaseNumericType(IrradiationUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -688,6 +688,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index cc83187a0a..67a4ce6f1a 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// http://en.wikipedia.org/wiki/Viscosity /// - public partial struct KinematicViscosity : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct KinematicViscosity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -707,7 +707,7 @@ private double AsBaseNumericType(KinematicViscosityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -752,6 +752,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index 1faa9dd594..4afd4575df 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Lapse rate is the rate at which Earth's atmospheric temperature decreases with an increase in altitude, or increases with the decrease in altitude. /// - public partial struct LapseRate : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct LapseRate : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -592,7 +592,7 @@ private double AsBaseNumericType(LapseRateUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -637,6 +637,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index 1ce0df6bbf..42d2d4a576 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Many different units of length have been used around the world. The main units in modern use are U.S. customary units in the United States and the Metric system elsewhere. British Imperial units are still used for some purposes in the United Kingdom and some other countries. The metric system is sub-divided into SI and non-SI units. /// - public partial struct Length : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Length : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -928,7 +928,7 @@ private double AsBaseNumericType(LengthUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -973,6 +973,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index 2161050829..4aae8d59e5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Level is the logarithm of the ratio of a quantity Q to a reference value of that quantity, Q₀, expressed in dimensionless units. /// - public partial struct Level : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Level : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -616,7 +616,7 @@ private double AsBaseNumericType(LevelUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -661,6 +661,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index f476bab98a..1849ecb00e 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// http://en.wikipedia.org/wiki/Linear_density /// - public partial struct LinearDensity : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct LinearDensity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -627,7 +627,7 @@ private double AsBaseNumericType(LinearDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -672,6 +672,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index 7705bd4000..79c62e0375 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Luminous_flux /// - public partial struct LuminousFlux : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct LuminousFlux : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -595,7 +595,7 @@ private double AsBaseNumericType(LuminousFluxUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -640,6 +640,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index 67862e4693..4cbafab638 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Luminous_intensity /// - public partial struct LuminousIntensity : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct LuminousIntensity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -595,7 +595,7 @@ private double AsBaseNumericType(LuminousIntensityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -640,6 +640,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index a72238762c..5b9af600c7 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Magnetic_field /// - public partial struct MagneticField : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct MagneticField : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -643,7 +643,7 @@ private double AsBaseNumericType(MagneticFieldUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -688,6 +688,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index 0ca0bf14eb..6ac6769ee3 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Magnetic_flux /// - public partial struct MagneticFlux : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct MagneticFlux : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -595,7 +595,7 @@ private double AsBaseNumericType(MagneticFluxUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -640,6 +640,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index e24b9101de..c11c3633c0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Magnetization /// - public partial struct Magnetization : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Magnetization : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -595,7 +595,7 @@ private double AsBaseNumericType(MagnetizationUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -640,6 +640,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index cfc394a677..9850058822 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In physics, mass (from Greek μᾶζα "barley cake, lump [of dough]") is a property of a physical system or body, giving rise to the phenomena of the body's resistance to being accelerated by a force and the strength of its mutual gravitational attraction with other bodies. Instruments such as mass balances or scales use those phenomena to measure mass. The SI unit of mass is the kilogram (kg). /// - public partial struct Mass : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Mass : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -944,7 +944,7 @@ private double AsBaseNumericType(MassUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -989,6 +989,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index 986a90a560..718fa308db 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Mass flow is the ratio of the mass change to the time during which the change occurred (value of mass changes per unit time). /// - public partial struct MassFlow : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct MassFlow : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -1072,7 +1072,7 @@ private double AsBaseNumericType(MassFlowUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -1117,6 +1117,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index d3d2d2f1d5..67e5e5a67b 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Mass flux is the mass flow rate per unit area. /// - public partial struct MassFlux : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct MassFlux : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -608,7 +608,7 @@ private double AsBaseNumericType(MassFluxUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -653,6 +653,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index 72fd273432..dd6093f6df 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// A property of body reflects how its mass is distributed with regard to an axis. /// - public partial struct MassMomentOfInertia : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct MassMomentOfInertia : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -1024,7 +1024,7 @@ private double AsBaseNumericType(MassMomentOfInertiaUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -1069,6 +1069,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index 18303a0639..df5caefee6 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Molar energy is the amount of energy stored in 1 mole of a substance. /// - public partial struct MolarEnergy : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct MolarEnergy : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -624,7 +624,7 @@ private double AsBaseNumericType(MolarEnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -669,6 +669,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index c219857e4a..5c0c215751 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Molar entropy is amount of energy required to increase temperature of 1 mole substance by 1 Kelvin. /// - public partial struct MolarEntropy : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct MolarEntropy : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -624,7 +624,7 @@ private double AsBaseNumericType(MolarEntropyUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -669,6 +669,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index 802f7a3322..c30f5f00e9 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In chemistry, the molar mass M is a physical property defined as the mass of a given substance (chemical element or chemical compound) divided by the amount of substance. /// - public partial struct MolarMass : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct MolarMass : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -768,7 +768,7 @@ private double AsBaseNumericType(MolarMassUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -813,6 +813,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index b29994e562..c45817bd23 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Molar_concentration /// - public partial struct Molarity : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Molarity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -707,7 +707,7 @@ private double AsBaseNumericType(MolarityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -752,6 +752,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index 5a1e0277e4..7eb4626eab 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Permeability_(electromagnetism) /// - public partial struct Permeability : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Permeability : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -595,7 +595,7 @@ private double AsBaseNumericType(PermeabilityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -640,6 +640,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index 9d4d1112ce..4c45d9c1c0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Permittivity /// - public partial struct Permittivity : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Permittivity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -595,7 +595,7 @@ private double AsBaseNumericType(PermittivityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -640,6 +640,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index 0823f8283b..61c90c0554 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In physics, power is the rate of doing work. It is equivalent to an amount of energy consumed per unit time. /// - public partial struct Power : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Power : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -896,7 +896,7 @@ private decimal AsBaseNumericType(PowerUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -941,6 +941,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index d9a03cb5ec..f4a841fe11 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The amount of power in a volume. /// - public partial struct PowerDensity : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct PowerDensity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -1280,7 +1280,7 @@ private double AsBaseNumericType(PowerDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -1325,6 +1325,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index f1a5dea122..17b4b5f340 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The strength of a signal expressed in decibels (dB) relative to one watt. /// - public partial struct PowerRatio : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct PowerRatio : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -616,7 +616,7 @@ private double AsBaseNumericType(PowerRatioUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -661,6 +661,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index e7f5e4c7bc..7065b2ec45 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Pressure (symbol: P or p) is the ratio of force to the area over which that force is distributed. Pressure is force per unit area applied in a direction perpendicular to the surface of an object. Gauge pressure (also spelled gage pressure)[a] is the pressure relative to the local atmospheric or ambient pressure. Pressure is measured in any unit of force divided by any unit of area. The SI unit of pressure is the newton per square metre, which is called the pascal (Pa) after the seventeenth-century philosopher and scientist Blaise Pascal. A pressure of 1 Pa is small; it approximately equals the pressure exerted by a dollar bill resting flat on a table. Everyday pressures are often stated in kilopascals (1 kPa = 1000 Pa). /// - public partial struct Pressure : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Pressure : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -1248,7 +1248,7 @@ private double AsBaseNumericType(PressureUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -1293,6 +1293,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index 066d24c627..45753ed80d 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Pressure change rate is the ratio of the pressure change to the time during which the change occurred (value of pressure changes per unit time). /// - public partial struct PressureChangeRate : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct PressureChangeRate : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -688,7 +688,7 @@ private double AsBaseNumericType(PressureChangeRateUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -733,6 +733,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index 060127e5a4..8dfd20f7d6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In mathematics, a ratio is a relationship between two numbers of the same kind (e.g., objects, persons, students, spoonfuls, units of whatever identical dimension), usually expressed as "a to b" or a:b, sometimes expressed arithmetically as a dimensionless quotient of the two that explicitly indicates how many times the first number contains the second (not necessarily an integer). /// - public partial struct Ratio : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Ratio : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -672,7 +672,7 @@ private double AsBaseNumericType(RatioUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -717,6 +717,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index 580e21133d..d3b1340741 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// The Volt-ampere reactive hour (expressed as varh) is the reactive power of one Volt-ampere reactive produced in one hour. /// - public partial struct ReactiveEnergy : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ReactiveEnergy : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -624,7 +624,7 @@ private double AsBaseNumericType(ReactiveEnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -669,6 +669,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index 65981a0e7a..7cd227ab1e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Volt-ampere reactive (var) is a unit by which reactive power is expressed in an AC electric power system. Reactive power exists in an AC circuit when the current and voltage are not in phase. /// - public partial struct ReactivePower : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ReactivePower : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -640,7 +640,7 @@ private double AsBaseNumericType(ReactivePowerUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -685,6 +685,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index d9c489ff10..ce798605c8 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Angular acceleration is the rate of change of rotational speed. /// - public partial struct RotationalAcceleration : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct RotationalAcceleration : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -624,7 +624,7 @@ private double AsBaseNumericType(RotationalAccelerationUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -669,6 +669,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index a25cda0fcf..9287f01c9b 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Rotational speed (sometimes called speed of revolution) is the number of complete rotations, revolutions, cycles, or turns per time unit. Rotational speed is a cyclic frequency, measured in radians per second or in hertz in the SI System by scientists, or in revolutions per minute (rpm or min-1) or revolutions per second in everyday life. The symbol for rotational speed is ω (the Greek lowercase letter "omega"). /// - public partial struct RotationalSpeed : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct RotationalSpeed : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -784,7 +784,7 @@ private double AsBaseNumericType(RotationalSpeedUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -829,6 +829,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index a20fa279f2..6925938322 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Stiffness#Rotational_stiffness /// - public partial struct RotationalStiffness : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct RotationalStiffness : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -624,7 +624,7 @@ private double AsBaseNumericType(RotationalStiffnessUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -669,6 +669,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index f4bae36418..bb1d69156d 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Stiffness#Rotational_stiffness /// - public partial struct RotationalStiffnessPerLength : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct RotationalStiffnessPerLength : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -624,7 +624,7 @@ private double AsBaseNumericType(RotationalStiffnessPerLengthUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -669,6 +669,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index d299740017..40c2360418 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Solid_angle /// - public partial struct SolidAngle : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct SolidAngle : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -595,7 +595,7 @@ private double AsBaseNumericType(SolidAngleUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -640,6 +640,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index 3a7f0468f5..84b2480bf0 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Specific_energy /// - public partial struct SpecificEnergy : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct SpecificEnergy : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -723,7 +723,7 @@ private double AsBaseNumericType(SpecificEnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -768,6 +768,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index c54191ad88..6f41222c87 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Specific entropy is an amount of energy required to raise temperature of a substance by 1 Kelvin per unit mass. /// - public partial struct SpecificEntropy : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct SpecificEntropy : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -704,7 +704,7 @@ private double AsBaseNumericType(SpecificEntropyUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -749,6 +749,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index c52daa22e5..30fe180126 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In thermodynamics, the specific volume of a substance is the ratio of the substance's volume to its mass. It is the reciprocal of density and an intrinsic property of matter as well. /// - public partial struct SpecificVolume : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct SpecificVolume : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -624,7 +624,7 @@ private double AsBaseNumericType(SpecificVolumeUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -669,6 +669,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index c3d13965f7..ba402bc7ed 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// http://en.wikipedia.org/wiki/Specificweight /// - public partial struct SpecificWeight : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct SpecificWeight : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -851,7 +851,7 @@ private double AsBaseNumericType(SpecificWeightUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -896,6 +896,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index 0eda083d72..aa4b1015aa 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In everyday use and in kinematics, the speed of an object is the magnitude of its velocity (the rate of change of its position); it is thus a scalar quantity.[1] The average speed of an object in an interval of time is the distance travelled by the object divided by the duration of the interval;[2] the instantaneous speed is the limit of the average speed as the duration of the time interval approaches zero. /// - public partial struct Speed : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Speed : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -1088,7 +1088,7 @@ private double AsBaseNumericType(SpeedUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -1133,6 +1133,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index 541f4265b9..0eec715b28 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// A temperature is a numerical measure of hot or cold. Its measurement is by detection of heat radiation or particle velocity or kinetic energy, or by the bulk behavior of a thermometric material. It may be calibrated in any of various temperature scales, Celsius, Fahrenheit, Kelvin, etc. The fundamental physical definition of temperature is provided by thermodynamics. /// - public partial struct Temperature : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Temperature : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -665,7 +665,7 @@ private double AsBaseNumericType(TemperatureUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -710,6 +710,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index 2b24f327ec..ecbd9fcceb 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Temperature change rate is the ratio of the temperature change to the time during which the change occurred (value of temperature changes per unit time). /// - public partial struct TemperatureChangeRate : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct TemperatureChangeRate : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -736,7 +736,7 @@ private double AsBaseNumericType(TemperatureChangeRateUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -781,6 +781,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index f189ebd280..65a1e90703 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Difference between two temperatures. The conversions are different than for Temperature. /// - public partial struct TemperatureDelta : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct TemperatureDelta : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -704,7 +704,7 @@ private double AsBaseNumericType(TemperatureDeltaUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -749,6 +749,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index 7491856acc..e2bd244368 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -52,7 +52,7 @@ namespace UnitsNet /// /// https://en.wikipedia.org/wiki/Thermal_Conductivity /// - public partial struct ThermalConductivity : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ThermalConductivity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -611,7 +611,7 @@ private double AsBaseNumericType(ThermalConductivityUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -656,6 +656,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index 00f032a6c2..172277d3cd 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Heat Transfer Coefficient or Thermal conductivity - indicates a materials ability to conduct heat. /// - public partial struct ThermalResistance : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct ThermalResistance : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -656,7 +656,7 @@ private double AsBaseNumericType(ThermalResistanceUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -701,6 +701,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index 7ee5f39f0e..10f7165ee1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Torque, moment or moment of force (see the terminology below), is the tendency of a force to rotate an object about an axis,[1] fulcrum, or pivot. Just as a force is a push or a pull, a torque can be thought of as a twist to an object. Mathematically, torque is defined as the cross product of the lever-arm distance and force, which tends to produce rotation. Loosely speaking, torque is a measure of the turning force on an object such as a bolt or a flywheel. For example, pushing or pulling the handle of a wrench connected to a nut or bolt produces a torque (turning force) that loosens or tightens the nut or bolt. /// - public partial struct Torque : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Torque : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -912,7 +912,7 @@ private double AsBaseNumericType(TorqueUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -957,6 +957,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index 65c06ecce1..92261f44db 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Vitamin A: 1 IU is the biological equivalent of 0.3 µg retinol, or of 0.6 µg beta-carotene. /// - public partial struct VitaminA : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct VitaminA : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -592,7 +592,7 @@ private double AsBaseNumericType(VitaminAUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -637,6 +637,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index 3772c486e6..2a5f61c34e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// Volume is the quantity of three-dimensional space enclosed by some closed boundary, for example, the space that a substance (solid, liquid, gas, or plasma) or shape occupies or contains.[1] Volume is often quantified numerically using the SI derived unit, the cubic metre. The volume of a container is generally understood to be the capacity of the container, i. e. the amount of fluid (gas or liquid) that the container could hold, rather than the amount of space the container itself displaces. /// - public partial struct Volume : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct Volume : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -1296,7 +1296,7 @@ private double AsBaseNumericType(VolumeUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -1341,6 +1341,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index 632a6c06f2..d63c0a4b9f 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -49,7 +49,7 @@ namespace UnitsNet /// /// In physics and engineering, in particular fluid dynamics and hydrometry, the volumetric flow rate, (also known as volume flow rate, rate of fluid flow or volume velocity) is the volume of fluid which passes through a given surface per unit time. The SI unit is m³/s (cubic meters per second). In US Customary Units and British Imperial Units, volumetric flow rate is often expressed as ft³/s (cubic feet per second). It is usually represented by the symbol Q. /// - public partial struct VolumeFlow : IQuantity, IEquatable, IComparable, IComparable, IConvertible + public partial struct VolumeFlow : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable { /// /// The numeric value this quantity was constructed with. @@ -1344,7 +1344,7 @@ private double AsBaseNumericType(VolumeFlowUnit unit) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -1389,6 +1389,60 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } + #endregion #region IConvertible Methods diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index f46760bcf8..c17f44f57f 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -101,7 +101,7 @@ if ($obsoleteAttribute) // Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic. public sealed partial class $quantityName : IQuantity "@; } else {@" - public partial struct $quantityName : IQuantity<$unitEnumName>, IEquatable<$quantityName>, IComparable, IComparable<$quantityName>, IConvertible + public partial struct $quantityName : IQuantity<$unitEnumName>, IEquatable<$quantityName>, IComparable, IComparable<$quantityName>, IConvertible, IFormattable "@; }@" { /// @@ -184,7 +184,7 @@ if ($obsoleteAttribute) /// String representation. public override string ToString() { - return ToString(null); + return ToString(null, 2); } /// @@ -252,6 +252,63 @@ if ($obsoleteAttribute) var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); return string.Format(provider, format, formatArgs); } +"@; # Windows Runtime Component does not support IFormatProvider type + if (!$wrc) {@" + + /// + /// Gets the string representation of this instance in the specified format string using . + /// + /// The format string. + /// The string representation. + public string ToString(string format) + { + return ToString(format, GlobalConfiguration.DefaultCulture); + } + + /// + /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. + /// + /// The format string. + /// Format to use for localization and number formatting. Defaults to if null. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + int digits = 0; + string formatString = format; + + if(string.IsNullOrWhiteSpace(formatString)) + formatString = "G"; + + formatString = formatString.ToUpper(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations<$unitEnumName>(Unit, formatProvider); + return abbreviations[digits]; + case "V": + return Value.ToString(formatProvider); + case "Q": + return Info.Name; + case "S": + return ToString(formatProvider, digits); + default: + throw new FormatException($"The {formatString} format string is not supported."); + } + } +"@; }@" #endregion "@; if ($wrc) {@" From 6eec03ee30cb62b95388e6101f97df2a61fea058 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Mon, 4 Feb 2019 11:19:23 -0500 Subject: [PATCH 02/21] Exception should show provided format string, not internally modified one --- .../GeneratedCode/Quantities/Acceleration.NetFramework.g.cs | 2 +- .../Quantities/AmountOfSubstance.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs | 2 +- .../Quantities/AreaMomentOfInertia.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs | 2 +- .../Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs | 2 +- .../Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs | 2 +- .../Quantities/ElectricAdmittance.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs | 2 +- .../Quantities/ElectricChargeDensity.NetFramework.g.cs | 2 +- .../Quantities/ElectricConductance.NetFramework.g.cs | 2 +- .../Quantities/ElectricConductivity.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs | 2 +- .../Quantities/ElectricCurrentDensity.NetFramework.g.cs | 2 +- .../Quantities/ElectricCurrentGradient.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/ElectricField.NetFramework.g.cs | 2 +- .../Quantities/ElectricInductance.NetFramework.g.cs | 2 +- .../Quantities/ElectricPotential.NetFramework.g.cs | 2 +- .../Quantities/ElectricPotentialAc.NetFramework.g.cs | 2 +- .../Quantities/ElectricPotentialDc.NetFramework.g.cs | 2 +- .../Quantities/ElectricResistance.NetFramework.g.cs | 2 +- .../Quantities/ElectricResistivity.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs | 2 +- .../Quantities/HeatTransferCoefficient.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs | 2 +- .../Quantities/KinematicViscosity.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs | 2 +- .../Quantities/LuminousIntensity.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/MagneticField.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/Magnetization.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs | 2 +- .../Quantities/MassMomentOfInertia.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/Permeability.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/Permittivity.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs | 2 +- .../Quantities/PressureChangeRate.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs | 2 +- .../Quantities/RotationalAcceleration.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs | 2 +- .../Quantities/RotationalStiffness.NetFramework.g.cs | 2 +- .../Quantities/RotationalStiffnessPerLength.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs | 2 +- .../Quantities/TemperatureChangeRate.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs | 2 +- .../Quantities/ThermalConductivity.NetFramework.g.cs | 2 +- .../Quantities/ThermalResistance.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs | 2 +- UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 | 2 +- 91 files changed, 91 insertions(+), 91 deletions(-) diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index 98d4122d1b..cc2c09eb56 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -879,7 +879,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index 50a0925d63..3a64ffa75b 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -911,7 +911,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index a3be5b143d..826c9ed72b 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -743,7 +743,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index 4816eb0770..48e4781fec 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -895,7 +895,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index 56cc6a6e40..87d249fa59 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -719,7 +719,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index 0bf9403634..a46efbe296 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -735,7 +735,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index 3dddbc295b..473f34e882 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -879,7 +879,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index a14aad11e0..1a5791d131 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -687,7 +687,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index 5af10c411e..940157677c 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -767,7 +767,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index ed54aaf78f..6bbffe07e1 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -1090,7 +1090,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index fb3d54e2ea..656a893838 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -719,7 +719,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index a294f13834..920bf85646 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -786,7 +786,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs index c36754ae28..e934a8020d 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs @@ -719,7 +719,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index 13d414b726..4f95977053 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -1298,7 +1298,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index b4aee68db6..c8f673e945 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -831,7 +831,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index 82d3aa52f9..c3610b174f 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -770,7 +770,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index 6b53654589..1f01d8b46a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -735,7 +735,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index ef97d4af6f..e4274314e8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -690,7 +690,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index 62dd626698..fd98668782 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -690,7 +690,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index f3f12bfe7c..f722cf7aa5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -722,7 +722,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index d639ced600..ffbc93a375 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -690,7 +690,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index e6192d9b45..1bc54742d5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -799,7 +799,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index 4204b354d7..8b88a4e2eb 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -690,7 +690,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index f4f401b77d..6c7484390d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -687,7 +687,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index c22800ec1a..1dbc85a4c5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -690,7 +690,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index 9f2b413192..7be90d42ab 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -738,7 +738,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index 8fedb4fd6f..871041a765 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -751,7 +751,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index c29943a734..15fc23bb5f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -751,7 +751,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index f12c4517cd..6152fd7fd6 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -751,7 +751,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index 54a7f44c97..df30214d0d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -751,7 +751,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index 9df8ac9ee7..b46daf1ba0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -898,7 +898,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index 978f8571b6..db5065bc8c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -1023,7 +1023,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index 0abcd89542..7af961a69e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -783,7 +783,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index 7502b5d33e..692c3f12b3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -879,7 +879,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index a6457130a0..084d51ba84 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -847,7 +847,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index 9e5caf177f..2b0532aba6 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -815,7 +815,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index 872141a66d..fb4cf41910 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -799,7 +799,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index c84953eadd..444267722e 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -959,7 +959,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index b148103d73..d9aa55aa76 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -703,7 +703,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index 3a84efc1b3..fa34ba13b4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -738,7 +738,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index 03df390312..c6d5bf8fb2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -1087,7 +1087,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index 0e22e4bc97..2ec90a0a17 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -895,7 +895,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index 92e5f9eee5..cd825369a8 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -738,7 +738,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index 67a4ce6f1a..da88b872c0 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -802,7 +802,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index 4afd4575df..0cdbb3e9d5 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -687,7 +687,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index 42d2d4a576..51a728b81a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -1023,7 +1023,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index 4aae8d59e5..b136687e57 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -711,7 +711,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index 1849ecb00e..f2f45bd266 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -722,7 +722,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index 79c62e0375..9fdad04b2f 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -690,7 +690,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index 4cbafab638..d7235cf56f 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -690,7 +690,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index 5b9af600c7..defc9d0341 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -738,7 +738,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index 6ac6769ee3..3d555ade28 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -690,7 +690,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index c11c3633c0..aaaa7ee86e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -690,7 +690,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index 9850058822..ce603acd29 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -1039,7 +1039,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index 718fa308db..c3fbed21a1 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -1167,7 +1167,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index 67e5e5a67b..e2a6e3a04d 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -703,7 +703,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index dd6093f6df..198734357a 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -1119,7 +1119,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index df5caefee6..e5138df256 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -719,7 +719,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index 5c0c215751..1978bfe355 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -719,7 +719,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index c30f5f00e9..d75d553556 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -863,7 +863,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index c45817bd23..c46c603224 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -802,7 +802,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index 7eb4626eab..bc0de93fca 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -690,7 +690,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index 4c45d9c1c0..2cbebd03d6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -690,7 +690,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index 61c90c0554..54ab9287ed 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -991,7 +991,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index f4a841fe11..dd43276bba 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -1375,7 +1375,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index 17b4b5f340..e9901c0698 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -711,7 +711,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index 7065b2ec45..ad88647388 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -1343,7 +1343,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index 45753ed80d..b637d0e79c 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -783,7 +783,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index 8dfd20f7d6..b35c7695d5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -767,7 +767,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index d3b1340741..6fad0817e9 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -719,7 +719,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index 7cd227ab1e..9c256be200 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -735,7 +735,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index ce798605c8..06fe3ca1e3 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -719,7 +719,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index 9287f01c9b..ab1873bb4a 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -879,7 +879,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index 6925938322..ed472894dc 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -719,7 +719,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index bb1d69156d..e87c8815d1 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -719,7 +719,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index 40c2360418..ac3d21d711 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -690,7 +690,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index 84b2480bf0..8010338ad6 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -818,7 +818,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index 6f41222c87..4df901a027 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -799,7 +799,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index 30fe180126..76d2765aaa 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -719,7 +719,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index ba402bc7ed..b0d54e41e7 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -946,7 +946,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index aa4b1015aa..6766674199 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -1183,7 +1183,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index 0eec715b28..e15e1452ee 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -760,7 +760,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index ecbd9fcceb..06adeb9264 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -831,7 +831,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index 65a1e90703..88d4436e7b 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -799,7 +799,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index e2bd244368..b62fef9b3e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -706,7 +706,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index 172277d3cd..3c4cf27c7b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -751,7 +751,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index 10f7165ee1..260e39d96d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -1007,7 +1007,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index 92261f44db..ebb56d7dd7 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -687,7 +687,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index 2a5f61c34e..bea182c369 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -1391,7 +1391,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index d63c0a4b9f..fd74232ea6 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -1439,7 +1439,7 @@ public string ToString(string format, IFormatProvider formatProvider) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index c17f44f57f..ec0f29ccf1 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -305,7 +305,7 @@ if ($obsoleteAttribute) case "S": return ToString(formatProvider, digits); default: - throw new FormatException($"The {formatString} format string is not supported."); + throw new FormatException($"The {format} format string is not supported."); } } "@; }@" From e73053cf46f914532dc16dbd0a45ae331dc713f7 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Thu, 14 Feb 2019 10:11:23 -0500 Subject: [PATCH 03/21] Removing obsolete changes after WRC script split --- .../Quantities/Acceleration.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Angle.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/ApparentPower.WindowsRuntimeComponent.g.cs | 2 +- .../GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/AreaDensity.WindowsRuntimeComponent.g.cs | 2 +- .../AreaMomentOfInertia.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/BitRate.WindowsRuntimeComponent.g.cs | 2 +- .../BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Capacitance.WindowsRuntimeComponent.g.cs | 2 +- .../CoefficientOfThermalExpansion.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Density.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Duration.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs | 2 +- .../ElectricChargeDensity.WindowsRuntimeComponent.g.cs | 2 +- .../ElectricConductance.WindowsRuntimeComponent.g.cs | 2 +- .../ElectricConductivity.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs | 2 +- .../ElectricCurrentDensity.WindowsRuntimeComponent.g.cs | 2 +- .../ElectricCurrentGradient.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/ElectricField.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs | 2 +- .../ElectricPotentialAc.WindowsRuntimeComponent.g.cs | 2 +- .../ElectricPotentialDc.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs | 2 +- .../ElectricResistivity.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Energy.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Entropy.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Force.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Frequency.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/HeatFlux.WindowsRuntimeComponent.g.cs | 2 +- .../HeatTransferCoefficient.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Illuminance.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Information.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Irradiance.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Irradiation.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/LapseRate.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Length.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Level.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/LinearDensity.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/MagneticField.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Magnetization.WindowsRuntimeComponent.g.cs | 2 +- .../GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/MassFlow.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/MassFlux.WindowsRuntimeComponent.g.cs | 2 +- .../MassMomentOfInertia.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/MolarMass.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Molarity.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Permeability.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Permittivity.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Power.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/PowerDensity.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/PowerRatio.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Pressure.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Ratio.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/ReactivePower.WindowsRuntimeComponent.g.cs | 2 +- .../RotationalAcceleration.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs | 2 +- .../RotationalStiffness.WindowsRuntimeComponent.g.cs | 2 +- .../RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/SolidAngle.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Speed.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Temperature.WindowsRuntimeComponent.g.cs | 2 +- .../TemperatureChangeRate.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs | 2 +- .../ThermalConductivity.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Torque.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/VitaminA.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/Volume.WindowsRuntimeComponent.g.cs | 2 +- .../Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs | 2 +- UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 | 3 --- 91 files changed, 90 insertions(+), 93 deletions(-) diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs index 1cac81b2f5..5a24b4703d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Acceleration.WindowsRuntimeComponent.g.cs @@ -744,7 +744,7 @@ private double AsBaseNumericType(AccelerationUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs index 771d47e94a..74eaf49233 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmountOfSubstance.WindowsRuntimeComponent.g.cs @@ -778,7 +778,7 @@ private double AsBaseNumericType(AmountOfSubstanceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs index a5a2018850..6fedad2667 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AmplitudeRatio.WindowsRuntimeComponent.g.cs @@ -591,7 +591,7 @@ private double AsBaseNumericType(AmplitudeRatioUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs index 8e2fdabe89..0a7b132b6a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Angle.WindowsRuntimeComponent.g.cs @@ -761,7 +761,7 @@ private double AsBaseNumericType(AngleUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs index ab29340930..02491d430c 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentEnergy.WindowsRuntimeComponent.g.cs @@ -574,7 +574,7 @@ private double AsBaseNumericType(ApparentEnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs index f1c44e687d..736c4a799a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ApparentPower.WindowsRuntimeComponent.g.cs @@ -591,7 +591,7 @@ private double AsBaseNumericType(ApparentPowerUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs index e0a1b5f72b..5ea87fb206 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Area.WindowsRuntimeComponent.g.cs @@ -744,7 +744,7 @@ private double AsBaseNumericType(AreaUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs index ba9969a25a..3614a5d136 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaDensity.WindowsRuntimeComponent.g.cs @@ -540,7 +540,7 @@ private double AsBaseNumericType(AreaDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs index 7259b7733c..88d37ff555 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/AreaMomentOfInertia.WindowsRuntimeComponent.g.cs @@ -625,7 +625,7 @@ private double AsBaseNumericType(AreaMomentOfInertiaUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs index 702e489885..34257f37d1 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BitRate.WindowsRuntimeComponent.g.cs @@ -968,7 +968,7 @@ private decimal AsBaseNumericType(BitRateUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs index 1394abf8b0..3dbfb0e34f 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.WindowsRuntimeComponent.g.cs @@ -574,7 +574,7 @@ private double AsBaseNumericType(BrakeSpecificFuelConsumptionUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs index 7feaa9f687..6117f22269 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Capacitance.WindowsRuntimeComponent.g.cs @@ -645,7 +645,7 @@ private double AsBaseNumericType(CapacitanceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/CoefficientOfThermalExpansion.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/CoefficientOfThermalExpansion.WindowsRuntimeComponent.g.cs index 18ffb25c3a..1c20fbc596 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/CoefficientOfThermalExpansion.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/CoefficientOfThermalExpansion.WindowsRuntimeComponent.g.cs @@ -574,7 +574,7 @@ private double AsBaseNumericType(CoefficientOfThermalExpansionUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs index ca524d3fce..77734f6274 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Density.WindowsRuntimeComponent.g.cs @@ -1189,7 +1189,7 @@ private double AsBaseNumericType(DensityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs index 70ce46bf7f..8a314fcdaa 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Duration.WindowsRuntimeComponent.g.cs @@ -693,7 +693,7 @@ private double AsBaseNumericType(DurationUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs index c212198d42..a1c3056e66 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/DynamicViscosity.WindowsRuntimeComponent.g.cs @@ -628,7 +628,7 @@ private double AsBaseNumericType(DynamicViscosityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs index a9afcb771d..d9450f3c66 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricAdmittance.WindowsRuntimeComponent.g.cs @@ -591,7 +591,7 @@ private double AsBaseNumericType(ElectricAdmittanceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs index 8629279e1a..dac584fb59 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCharge.WindowsRuntimeComponent.g.cs @@ -543,7 +543,7 @@ private double AsBaseNumericType(ElectricChargeUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs index a99776d724..8ec2b6148b 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricChargeDensity.WindowsRuntimeComponent.g.cs @@ -543,7 +543,7 @@ private double AsBaseNumericType(ElectricChargeDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs index ab9dde22ed..3b7cb40c27 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductance.WindowsRuntimeComponent.g.cs @@ -577,7 +577,7 @@ private double AsBaseNumericType(ElectricConductanceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs index 1acbbe8ac2..cb1b3d25c0 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricConductivity.WindowsRuntimeComponent.g.cs @@ -543,7 +543,7 @@ private double AsBaseNumericType(ElectricConductivityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs index 319896daac..81a13b19de 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrent.WindowsRuntimeComponent.g.cs @@ -659,7 +659,7 @@ private double AsBaseNumericType(ElectricCurrentUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs index 7d59cd34b7..29294a8f7d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentDensity.WindowsRuntimeComponent.g.cs @@ -543,7 +543,7 @@ private double AsBaseNumericType(ElectricCurrentDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs index c01cc48de9..1c3272bf3e 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricCurrentGradient.WindowsRuntimeComponent.g.cs @@ -540,7 +540,7 @@ private double AsBaseNumericType(ElectricCurrentGradientUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs index 114a86f431..e9ab0ab2d3 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricField.WindowsRuntimeComponent.g.cs @@ -543,7 +543,7 @@ private double AsBaseNumericType(ElectricFieldUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs index 30e021f062..54098c0ef0 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricInductance.WindowsRuntimeComponent.g.cs @@ -594,7 +594,7 @@ private double AsBaseNumericType(ElectricInductanceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs index 5a3a32c3d3..415273724a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotential.WindowsRuntimeComponent.g.cs @@ -608,7 +608,7 @@ private double AsBaseNumericType(ElectricPotentialUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs index c9d178b952..752a911dde 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialAc.WindowsRuntimeComponent.g.cs @@ -608,7 +608,7 @@ private double AsBaseNumericType(ElectricPotentialAcUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs index bac8d228ed..4d65a756af 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricPotentialDc.WindowsRuntimeComponent.g.cs @@ -608,7 +608,7 @@ private double AsBaseNumericType(ElectricPotentialDcUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs index af8195aeb9..50cabb6dc6 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistance.WindowsRuntimeComponent.g.cs @@ -608,7 +608,7 @@ private double AsBaseNumericType(ElectricResistanceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs index 9c64af4a84..3f0fe305d9 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ElectricResistivity.WindowsRuntimeComponent.g.cs @@ -764,7 +764,7 @@ private double AsBaseNumericType(ElectricResistivityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs index 959cab86b6..d38f87ac85 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Energy.WindowsRuntimeComponent.g.cs @@ -897,7 +897,7 @@ private double AsBaseNumericType(EnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs index bd316d9eb3..e8dd884929 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Entropy.WindowsRuntimeComponent.g.cs @@ -642,7 +642,7 @@ private double AsBaseNumericType(EntropyUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs index 2db62d36a6..5d50e9b6a2 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Force.WindowsRuntimeComponent.g.cs @@ -744,7 +744,7 @@ private double AsBaseNumericType(ForceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs index 3cfc38de10..5e12e1bceb 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForceChangeRate.WindowsRuntimeComponent.g.cs @@ -710,7 +710,7 @@ private double AsBaseNumericType(ForceChangeRateUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs index 721a52805a..7034620f92 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ForcePerLength.WindowsRuntimeComponent.g.cs @@ -676,7 +676,7 @@ private double AsBaseNumericType(ForcePerLengthUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs index 72b257278c..7e3dfa3d5d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Frequency.WindowsRuntimeComponent.g.cs @@ -659,7 +659,7 @@ private double AsBaseNumericType(FrequencyUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs index 725454a5ba..1ba40d0a98 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatFlux.WindowsRuntimeComponent.g.cs @@ -829,7 +829,7 @@ private double AsBaseNumericType(HeatFluxUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs index 022eb09ce8..ce2d7b1062 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/HeatTransferCoefficient.WindowsRuntimeComponent.g.cs @@ -557,7 +557,7 @@ private double AsBaseNumericType(HeatTransferCoefficientUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs index 39c6b9ec9c..2d348c5a85 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Illuminance.WindowsRuntimeComponent.g.cs @@ -594,7 +594,7 @@ private double AsBaseNumericType(IlluminanceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs index d5f7df2b09..b126d0a891 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Information.WindowsRuntimeComponent.g.cs @@ -965,7 +965,7 @@ private decimal AsBaseNumericType(InformationUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs index a07a1d494d..7979bab277 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiance.WindowsRuntimeComponent.g.cs @@ -761,7 +761,7 @@ private double AsBaseNumericType(IrradianceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs index 2667d12c2c..3b6ed5fc78 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Irradiation.WindowsRuntimeComponent.g.cs @@ -594,7 +594,7 @@ private double AsBaseNumericType(IrradiationUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs index c127ed3b15..47eb862708 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/KinematicViscosity.WindowsRuntimeComponent.g.cs @@ -662,7 +662,7 @@ private double AsBaseNumericType(KinematicViscosityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs index 339c70db83..e648c2f4b9 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LapseRate.WindowsRuntimeComponent.g.cs @@ -540,7 +540,7 @@ private double AsBaseNumericType(LapseRateUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs index 6d77f1dd73..bbd0efe6d5 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Length.WindowsRuntimeComponent.g.cs @@ -897,7 +897,7 @@ private double AsBaseNumericType(LengthUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs index 5106661c90..9a40f7bd34 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Level.WindowsRuntimeComponent.g.cs @@ -557,7 +557,7 @@ private double AsBaseNumericType(LevelUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs index f1fe85681d..370733f4d1 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LinearDensity.WindowsRuntimeComponent.g.cs @@ -577,7 +577,7 @@ private double AsBaseNumericType(LinearDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs index 3db880dc0b..551ebd8d77 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousFlux.WindowsRuntimeComponent.g.cs @@ -543,7 +543,7 @@ private double AsBaseNumericType(LuminousFluxUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs index 8ba530db64..d19b219fd6 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/LuminousIntensity.WindowsRuntimeComponent.g.cs @@ -543,7 +543,7 @@ private double AsBaseNumericType(LuminousIntensityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs index 2053a552a1..09052e2e29 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticField.WindowsRuntimeComponent.g.cs @@ -594,7 +594,7 @@ private double AsBaseNumericType(MagneticFieldUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs index 0963fb6fd3..4372595051 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MagneticFlux.WindowsRuntimeComponent.g.cs @@ -543,7 +543,7 @@ private double AsBaseNumericType(MagneticFluxUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs index 4d29a36d2e..078e302592 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Magnetization.WindowsRuntimeComponent.g.cs @@ -543,7 +543,7 @@ private double AsBaseNumericType(MagnetizationUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs index 936ec1da39..8e295f87b6 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs @@ -914,7 +914,7 @@ private double AsBaseNumericType(MassUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs index dbee9529c3..3b48009c6a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlow.WindowsRuntimeComponent.g.cs @@ -1050,7 +1050,7 @@ private double AsBaseNumericType(MassFlowUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs index 724651e038..1caa1bc475 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassFlux.WindowsRuntimeComponent.g.cs @@ -557,7 +557,7 @@ private double AsBaseNumericType(MassFluxUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs index 6527b28239..7ec0e91b52 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MassMomentOfInertia.WindowsRuntimeComponent.g.cs @@ -999,7 +999,7 @@ private double AsBaseNumericType(MassMomentOfInertiaUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs index 68d2c9acf6..8641fcb30d 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEnergy.WindowsRuntimeComponent.g.cs @@ -574,7 +574,7 @@ private double AsBaseNumericType(MolarEnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs index ac995b79b5..434a0e5a3b 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarEntropy.WindowsRuntimeComponent.g.cs @@ -574,7 +574,7 @@ private double AsBaseNumericType(MolarEntropyUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs index 62d3b21976..5cc8d75f8c 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/MolarMass.WindowsRuntimeComponent.g.cs @@ -727,7 +727,7 @@ private double AsBaseNumericType(MolarMassUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs index 1bede5173e..108a8baa44 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Molarity.WindowsRuntimeComponent.g.cs @@ -662,7 +662,7 @@ private double AsBaseNumericType(MolarityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs index 5c8075e083..56507756de 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permeability.WindowsRuntimeComponent.g.cs @@ -543,7 +543,7 @@ private double AsBaseNumericType(PermeabilityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs index 01a1bc10e1..2e361a2ad3 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Permittivity.WindowsRuntimeComponent.g.cs @@ -543,7 +543,7 @@ private double AsBaseNumericType(PermittivityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs index 70ee94cade..50313b5782 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Power.WindowsRuntimeComponent.g.cs @@ -863,7 +863,7 @@ private decimal AsBaseNumericType(PowerUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs index e0fdf9e338..358deae752 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerDensity.WindowsRuntimeComponent.g.cs @@ -1271,7 +1271,7 @@ private double AsBaseNumericType(PowerDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs index 858d64a889..ed0be5510a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PowerRatio.WindowsRuntimeComponent.g.cs @@ -557,7 +557,7 @@ private double AsBaseNumericType(PowerRatioUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs index 1c6887a842..6dbddf414a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Pressure.WindowsRuntimeComponent.g.cs @@ -1237,7 +1237,7 @@ private double AsBaseNumericType(PressureUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs index f5c2ba19bc..9c4fba55e7 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/PressureChangeRate.WindowsRuntimeComponent.g.cs @@ -642,7 +642,7 @@ private double AsBaseNumericType(PressureChangeRateUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs index 323e8efc4c..480a34149a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Ratio.WindowsRuntimeComponent.g.cs @@ -625,7 +625,7 @@ private double AsBaseNumericType(RatioUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs index 4fdd94a600..efcfef5915 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactiveEnergy.WindowsRuntimeComponent.g.cs @@ -574,7 +574,7 @@ private double AsBaseNumericType(ReactiveEnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs index 7563665cd0..803808fa59 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ReactivePower.WindowsRuntimeComponent.g.cs @@ -591,7 +591,7 @@ private double AsBaseNumericType(ReactivePowerUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs index baedf6da88..bb92fc4740 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalAcceleration.WindowsRuntimeComponent.g.cs @@ -574,7 +574,7 @@ private double AsBaseNumericType(RotationalAccelerationUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs index 06c9a8f464..0865dfdc24 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalSpeed.WindowsRuntimeComponent.g.cs @@ -744,7 +744,7 @@ private double AsBaseNumericType(RotationalSpeedUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs index b542d8e2a8..cc66f37871 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffness.WindowsRuntimeComponent.g.cs @@ -574,7 +574,7 @@ private double AsBaseNumericType(RotationalStiffnessUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs index 09ecda7142..d4aaa2b1e4 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/RotationalStiffnessPerLength.WindowsRuntimeComponent.g.cs @@ -574,7 +574,7 @@ private double AsBaseNumericType(RotationalStiffnessPerLengthUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs index 4deb71b42b..c51d3bbcdb 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SolidAngle.WindowsRuntimeComponent.g.cs @@ -543,7 +543,7 @@ private double AsBaseNumericType(SolidAngleUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs index 06f45d8205..81f010a799 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs @@ -679,7 +679,7 @@ private double AsBaseNumericType(SpecificEnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs index 7df1ae88f8..2205433759 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEntropy.WindowsRuntimeComponent.g.cs @@ -659,7 +659,7 @@ private double AsBaseNumericType(SpecificEntropyUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs index f40b59330b..c85bffa702 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificVolume.WindowsRuntimeComponent.g.cs @@ -574,7 +574,7 @@ private double AsBaseNumericType(SpecificVolumeUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs index c6b3503b85..9b57b4fbb3 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificWeight.WindowsRuntimeComponent.g.cs @@ -815,7 +815,7 @@ private double AsBaseNumericType(SpecificWeightUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs index 97b04c9781..8c898e219a 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Speed.WindowsRuntimeComponent.g.cs @@ -1067,7 +1067,7 @@ private double AsBaseNumericType(SpeedUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs index 56077c6099..5440295b68 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Temperature.WindowsRuntimeComponent.g.cs @@ -659,7 +659,7 @@ private double AsBaseNumericType(TemperatureUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs index b1f9a470c6..ce7658ea09 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureChangeRate.WindowsRuntimeComponent.g.cs @@ -693,7 +693,7 @@ private double AsBaseNumericType(TemperatureChangeRateUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs index 0c4e955140..edee17d7c2 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/TemperatureDelta.WindowsRuntimeComponent.g.cs @@ -659,7 +659,7 @@ private double AsBaseNumericType(TemperatureDeltaUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs index fd4296173d..4c48dd1fba 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalConductivity.WindowsRuntimeComponent.g.cs @@ -560,7 +560,7 @@ private double AsBaseNumericType(ThermalConductivityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs index 0644128aa2..899966dbf7 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/ThermalResistance.WindowsRuntimeComponent.g.cs @@ -608,7 +608,7 @@ private double AsBaseNumericType(ThermalResistanceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs index 39dda17119..5aeab4ed37 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Torque.WindowsRuntimeComponent.g.cs @@ -880,7 +880,7 @@ private double AsBaseNumericType(TorqueUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs index baeb0a1ce7..7bedea0e13 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VitaminA.WindowsRuntimeComponent.g.cs @@ -540,7 +540,7 @@ private double AsBaseNumericType(VitaminAUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs index 71f67f9805..3ddd7240cc 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Volume.WindowsRuntimeComponent.g.cs @@ -1288,7 +1288,7 @@ private double AsBaseNumericType(VolumeUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs index 2692733d4a..e8192ec645 100644 --- a/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs +++ b/UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/VolumeFlow.WindowsRuntimeComponent.g.cs @@ -1339,7 +1339,7 @@ private double AsBaseNumericType(VolumeFlowUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString(null); } /// diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index af70a2562c..a347ae3494 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -187,8 +187,6 @@ if ($obsoleteAttribute) var formatArgs = UnitFormatter.GetFormatArgs(Unit, value, provider, args); return string.Format(provider, format, formatArgs); } -"@; # Windows Runtime Component does not support IFormatProvider type - if (!$wrc) {@" /// /// Gets the string representation of this instance in the specified format string using . @@ -243,7 +241,6 @@ if ($obsoleteAttribute) throw new FormatException($"The {format} format string is not supported."); } } -"@; }@" #endregion From 96119ddbba28116eae85c148b54a502e2fe1adcd Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Thu, 14 Feb 2019 10:21:36 -0500 Subject: [PATCH 04/21] ToString should call formattable with "G" per MSDN docs --- .../GeneratedCode/Quantities/Acceleration.NetFramework.g.cs | 2 +- .../Quantities/AmountOfSubstance.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs | 2 +- .../Quantities/AreaMomentOfInertia.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs | 2 +- .../Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs | 2 +- .../Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs | 2 +- .../Quantities/ElectricAdmittance.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs | 2 +- .../Quantities/ElectricChargeDensity.NetFramework.g.cs | 2 +- .../Quantities/ElectricConductance.NetFramework.g.cs | 2 +- .../Quantities/ElectricConductivity.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs | 2 +- .../Quantities/ElectricCurrentDensity.NetFramework.g.cs | 2 +- .../Quantities/ElectricCurrentGradient.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/ElectricField.NetFramework.g.cs | 2 +- .../Quantities/ElectricInductance.NetFramework.g.cs | 2 +- .../Quantities/ElectricPotential.NetFramework.g.cs | 2 +- .../Quantities/ElectricPotentialAc.NetFramework.g.cs | 2 +- .../Quantities/ElectricPotentialDc.NetFramework.g.cs | 2 +- .../Quantities/ElectricResistance.NetFramework.g.cs | 2 +- .../Quantities/ElectricResistivity.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs | 2 +- .../Quantities/HeatTransferCoefficient.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs | 2 +- .../Quantities/KinematicViscosity.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs | 2 +- .../Quantities/LuminousIntensity.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/MagneticField.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/Magnetization.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs | 2 +- .../Quantities/MassMomentOfInertia.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/Permeability.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/Permittivity.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs | 2 +- .../Quantities/PressureChangeRate.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs | 2 +- .../Quantities/RotationalAcceleration.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs | 2 +- .../Quantities/RotationalStiffness.NetFramework.g.cs | 2 +- .../Quantities/RotationalStiffnessPerLength.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs | 2 +- .../Quantities/TemperatureChangeRate.NetFramework.g.cs | 2 +- .../GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs | 2 +- .../Quantities/ThermalConductivity.NetFramework.g.cs | 2 +- .../Quantities/ThermalResistance.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs | 2 +- UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 | 2 +- 91 files changed, 91 insertions(+), 91 deletions(-) diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index cee20131c6..1ea5fc30f9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -782,7 +782,7 @@ private double AsBaseNumericType(AccelerationUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index ddc4169026..6ee6e84dfd 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -814,7 +814,7 @@ private double AsBaseNumericType(AmountOfSubstanceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index 90f4506261..0d74b27c55 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -646,7 +646,7 @@ private double AsBaseNumericType(AmplitudeRatioUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index 49eedfb1ba..dbc8379537 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -798,7 +798,7 @@ private double AsBaseNumericType(AngleUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index 4174ef0b36..2f529750b8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -622,7 +622,7 @@ private double AsBaseNumericType(ApparentEnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index d84e13ebfa..033d38e8b2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -638,7 +638,7 @@ private double AsBaseNumericType(ApparentPowerUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index 41114359bb..8b7ecbfd00 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -782,7 +782,7 @@ private double AsBaseNumericType(AreaUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index d2a62f6960..c6a7ce73b0 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -590,7 +590,7 @@ private double AsBaseNumericType(AreaDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index b7bcda483b..19456c947f 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -670,7 +670,7 @@ private double AsBaseNumericType(AreaMomentOfInertiaUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index f0126a9919..b71efa0c42 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -993,7 +993,7 @@ private decimal AsBaseNumericType(BitRateUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index 68c78421ff..d169403a21 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -622,7 +622,7 @@ private double AsBaseNumericType(BrakeSpecificFuelConsumptionUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index e9f0611198..26f04eee65 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -689,7 +689,7 @@ private double AsBaseNumericType(CapacitanceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs index 5ce1ade1da..841c6410b7 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs @@ -622,7 +622,7 @@ private double AsBaseNumericType(CoefficientOfThermalExpansionUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index 9198857070..65b5d23ae2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -1201,7 +1201,7 @@ private double AsBaseNumericType(DensityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index 5404b60df3..35d9304e0a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -734,7 +734,7 @@ private double AsBaseNumericType(DurationUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index 6542e833d4..40b09d1225 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -673,7 +673,7 @@ private double AsBaseNumericType(DynamicViscosityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index b589746642..980d06829f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -638,7 +638,7 @@ private double AsBaseNumericType(ElectricAdmittanceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index a63ad3410d..65c74a6872 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -593,7 +593,7 @@ private double AsBaseNumericType(ElectricChargeUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index 843e51cac3..a7190559c2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -593,7 +593,7 @@ private double AsBaseNumericType(ElectricChargeDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index 93973ae24c..8c82900678 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -625,7 +625,7 @@ private double AsBaseNumericType(ElectricConductanceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index c586d2948a..d3f4921c7f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -593,7 +593,7 @@ private double AsBaseNumericType(ElectricConductivityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index 91dad51fa4..dfcb85f85f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -702,7 +702,7 @@ private double AsBaseNumericType(ElectricCurrentUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index 837fd0270c..4b346091be 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -593,7 +593,7 @@ private double AsBaseNumericType(ElectricCurrentDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index cb896fc267..46555395f7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -590,7 +590,7 @@ private double AsBaseNumericType(ElectricCurrentGradientUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index 860d32983e..1cbe1bb543 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -593,7 +593,7 @@ private double AsBaseNumericType(ElectricFieldUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index 1f6ec750b0..c4706d4dd2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -641,7 +641,7 @@ private double AsBaseNumericType(ElectricInductanceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index 4d25597fe2..10226aa8ac 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -654,7 +654,7 @@ private double AsBaseNumericType(ElectricPotentialUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index 22479f499d..71bf2320dc 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -654,7 +654,7 @@ private double AsBaseNumericType(ElectricPotentialAcUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index 87b0109fdf..0ee84ef116 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -654,7 +654,7 @@ private double AsBaseNumericType(ElectricPotentialDcUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index ed4c1d89aa..24cd27d3e5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -654,7 +654,7 @@ private double AsBaseNumericType(ElectricResistanceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index 0bcad1b0c6..1b97d50eed 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -801,7 +801,7 @@ private double AsBaseNumericType(ElectricResistivityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index c0507a8c37..2068ab720e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -926,7 +926,7 @@ private double AsBaseNumericType(EnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index 9af667b1eb..5607ee27b5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -686,7 +686,7 @@ private double AsBaseNumericType(EntropyUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index d41d9313e4..7c97013271 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -782,7 +782,7 @@ private double AsBaseNumericType(ForceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index b2e7650167..d0cc8ff831 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -750,7 +750,7 @@ private double AsBaseNumericType(ForceChangeRateUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index 9b6bb79d2b..94e77ea4b7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -718,7 +718,7 @@ private double AsBaseNumericType(ForcePerLengthUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index 2b41d36b7e..39d0657bcd 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -702,7 +702,7 @@ private double AsBaseNumericType(FrequencyUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index 897e2d2c63..82535b30a8 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -862,7 +862,7 @@ private double AsBaseNumericType(HeatFluxUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index fa5e959e38..ff9b6cfe37 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -606,7 +606,7 @@ private double AsBaseNumericType(HeatTransferCoefficientUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index d5644445f1..f7b9d9df65 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -641,7 +641,7 @@ private double AsBaseNumericType(IlluminanceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index aaf06e2dc0..85dd13a73a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -990,7 +990,7 @@ private decimal AsBaseNumericType(InformationUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index 5824f1fa76..3396c95e50 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -798,7 +798,7 @@ private double AsBaseNumericType(IrradianceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index 215f8855fb..31d462e831 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -641,7 +641,7 @@ private double AsBaseNumericType(IrradiationUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index 49badc1348..1bd4d33c7c 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -705,7 +705,7 @@ private double AsBaseNumericType(KinematicViscosityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index 1dfffb5985..a5f9e4a77c 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -590,7 +590,7 @@ private double AsBaseNumericType(LapseRateUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index 3a79a0c9bc..5543013fd7 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -926,7 +926,7 @@ private double AsBaseNumericType(LengthUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index 38b187a6a4..dfac2ab278 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -614,7 +614,7 @@ private double AsBaseNumericType(LevelUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index fd4f3358da..98845fb484 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -625,7 +625,7 @@ private double AsBaseNumericType(LinearDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index d4cb9ec62f..6fa8b8de19 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -593,7 +593,7 @@ private double AsBaseNumericType(LuminousFluxUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index 0593d714df..225cfa6654 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -593,7 +593,7 @@ private double AsBaseNumericType(LuminousIntensityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index 6dfb738ac7..2b72e7e7e6 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -641,7 +641,7 @@ private double AsBaseNumericType(MagneticFieldUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index 7e880efa2b..c222d5fd8a 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -593,7 +593,7 @@ private double AsBaseNumericType(MagneticFluxUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index ac764dbb5e..6a16a2bec9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -593,7 +593,7 @@ private double AsBaseNumericType(MagnetizationUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index 2583d629b7..6e2ad4a2cb 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -942,7 +942,7 @@ private double AsBaseNumericType(MassUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index 6c818139d8..dace17739d 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -1070,7 +1070,7 @@ private double AsBaseNumericType(MassFlowUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index 308ee98d92..b094dcc1a8 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -606,7 +606,7 @@ private double AsBaseNumericType(MassFluxUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index 74b3157795..c37a71cda1 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -1022,7 +1022,7 @@ private double AsBaseNumericType(MassMomentOfInertiaUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index 856fcbaa06..1c16010643 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -622,7 +622,7 @@ private double AsBaseNumericType(MolarEnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index f2ff2fdead..f7ee6b5b5e 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -622,7 +622,7 @@ private double AsBaseNumericType(MolarEntropyUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index 8de1cd921f..1410910a10 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -766,7 +766,7 @@ private double AsBaseNumericType(MolarMassUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index cb1ac869b3..6ad8a8b718 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -705,7 +705,7 @@ private double AsBaseNumericType(MolarityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index 5c49323033..c57d52c14a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -593,7 +593,7 @@ private double AsBaseNumericType(PermeabilityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index 1094becca2..5b327ba128 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -593,7 +593,7 @@ private double AsBaseNumericType(PermittivityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index 99e248c648..7a3adc1905 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -894,7 +894,7 @@ private decimal AsBaseNumericType(PowerUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index 71431487d9..71451b2a5d 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -1278,7 +1278,7 @@ private double AsBaseNumericType(PowerDensityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index 7852ba398d..edc0b0acda 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -614,7 +614,7 @@ private double AsBaseNumericType(PowerRatioUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index 3ea3de042e..28fced282c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -1246,7 +1246,7 @@ private double AsBaseNumericType(PressureUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index aa0a2fa1c7..82f06570da 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -686,7 +686,7 @@ private double AsBaseNumericType(PressureChangeRateUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index 64c5efd687..906f974c2a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -670,7 +670,7 @@ private double AsBaseNumericType(RatioUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index cf251a4b7b..71e784c012 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -622,7 +622,7 @@ private double AsBaseNumericType(ReactiveEnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index 34bde8d0a8..b450731d1f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -638,7 +638,7 @@ private double AsBaseNumericType(ReactivePowerUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index 78c68e675a..070a4c275a 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -622,7 +622,7 @@ private double AsBaseNumericType(RotationalAccelerationUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index 5bfc9a2548..772299b7a1 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -782,7 +782,7 @@ private double AsBaseNumericType(RotationalSpeedUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index 2c5368e0c1..8f562244d2 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -622,7 +622,7 @@ private double AsBaseNumericType(RotationalStiffnessUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index 78ef23c7d0..d6f9d3248a 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -622,7 +622,7 @@ private double AsBaseNumericType(RotationalStiffnessPerLengthUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index 9cd7970cbb..17ba1c32b0 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -593,7 +593,7 @@ private double AsBaseNumericType(SolidAngleUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index e2675cdaf4..fca871b9c4 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -721,7 +721,7 @@ private double AsBaseNumericType(SpecificEnergyUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index 2f13c6f0c3..29b9eaf29a 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -702,7 +702,7 @@ private double AsBaseNumericType(SpecificEntropyUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index a5993ffecd..dbfeaa029b 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -622,7 +622,7 @@ private double AsBaseNumericType(SpecificVolumeUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index bcc540675c..ee04bffd20 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -849,7 +849,7 @@ private double AsBaseNumericType(SpecificWeightUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index 441622a1fe..4471c67ae6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -1086,7 +1086,7 @@ private double AsBaseNumericType(SpeedUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index 820e219997..64a260d73a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -663,7 +663,7 @@ private double AsBaseNumericType(TemperatureUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index d5d872d06c..dcb13ea71f 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -734,7 +734,7 @@ private double AsBaseNumericType(TemperatureChangeRateUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index da2ae0ec06..413d8ba592 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -702,7 +702,7 @@ private double AsBaseNumericType(TemperatureDeltaUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index 5d74599c32..4fd9c89831 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -609,7 +609,7 @@ private double AsBaseNumericType(ThermalConductivityUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index a357ca7af2..6df689c67a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -654,7 +654,7 @@ private double AsBaseNumericType(ThermalResistanceUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index 83b652cb5d..9852864b86 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -910,7 +910,7 @@ private double AsBaseNumericType(TorqueUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index e5c72607c7..80d21210fe 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -590,7 +590,7 @@ private double AsBaseNumericType(VitaminAUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index adb3242d56..5c982d01ea 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -1294,7 +1294,7 @@ private double AsBaseNumericType(VolumeUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index 9633359d06..8b007804aa 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -1342,7 +1342,7 @@ private double AsBaseNumericType(VolumeFlowUnit unit) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index a347ae3494..31f73908e4 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -143,7 +143,7 @@ if ($obsoleteAttribute) /// String representation. public override string ToString() { - return ToString(null, 2); + return ToString("G"); } /// From 9affc99393ad64da9c76dde9b7a0d0c532a56d84 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Mon, 18 Feb 2019 14:11:10 -0500 Subject: [PATCH 05/21] Adding test to make sure format strings are case insensitive --- UnitsNet.Tests/QuantityIFormattableTests.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/UnitsNet.Tests/QuantityIFormattableTests.cs b/UnitsNet.Tests/QuantityIFormattableTests.cs index 265637536f..47fac2d933 100644 --- a/UnitsNet.Tests/QuantityIFormattableTests.cs +++ b/UnitsNet.Tests/QuantityIFormattableTests.cs @@ -53,5 +53,15 @@ public void SFormatEqualsSignificantDigits() Assert.Equal(length.ToString(null, 4), length.ToString("S4")); Assert.Equal(length.ToString(null, 5), length.ToString("S5")); } + + [Fact] + public void FormatStringsAreCaseInsensitive() + { + Assert.Equal(length.ToString("g"), length.ToString("G")); + Assert.Equal(length.ToString("a"), length.ToString("A")); + Assert.Equal(length.ToString("v"), length.ToString("V")); + Assert.Equal(length.ToString("q"), length.ToString("Q")); + Assert.Equal(length.ToString("s"), length.ToString("S")); + } } } From ae49bcb8261640bb49fd21e67c9a6dcfc5480b12 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Mon, 18 Feb 2019 14:24:38 -0500 Subject: [PATCH 06/21] Add test for exception with invalid format string --- UnitsNet.Tests/QuantityIFormattableTests.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/UnitsNet.Tests/QuantityIFormattableTests.cs b/UnitsNet.Tests/QuantityIFormattableTests.cs index 47fac2d933..4dec7998bf 100644 --- a/UnitsNet.Tests/QuantityIFormattableTests.cs +++ b/UnitsNet.Tests/QuantityIFormattableTests.cs @@ -1,4 +1,5 @@ -using UnitsNet.Units; +using System; +using UnitsNet.Units; using Xunit; namespace UnitsNet.Tests @@ -63,5 +64,11 @@ public void FormatStringsAreCaseInsensitive() Assert.Equal(length.ToString("q"), length.ToString("Q")); Assert.Equal(length.ToString("s"), length.ToString("S")); } + + [Fact] + public void UnsupportedFormatStringThrowsException() + { + Assert.Throws(() => length.ToString("Z")); + } } } From a0241b1a32fb88b5997342772a44b8aaaadd422e Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Mon, 18 Feb 2019 14:26:11 -0500 Subject: [PATCH 07/21] Check null or empty only for G format string. Change ToUpper to ToUpperInvariant for correct behavior with some cultures. --- .../GeneratedCode/Quantities/Acceleration.NetFramework.g.cs | 4 ++-- .../Quantities/AmountOfSubstance.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs | 4 ++-- .../Quantities/AreaMomentOfInertia.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs | 4 ++-- .../Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/Capacitance.NetFramework.g.cs | 4 ++-- .../CoefficientOfThermalExpansion.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs | 4 ++-- .../Quantities/DynamicViscosity.NetFramework.g.cs | 4 ++-- .../Quantities/ElectricAdmittance.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs | 4 ++-- .../Quantities/ElectricChargeDensity.NetFramework.g.cs | 4 ++-- .../Quantities/ElectricConductance.NetFramework.g.cs | 4 ++-- .../Quantities/ElectricConductivity.NetFramework.g.cs | 4 ++-- .../Quantities/ElectricCurrent.NetFramework.g.cs | 4 ++-- .../Quantities/ElectricCurrentDensity.NetFramework.g.cs | 4 ++-- .../Quantities/ElectricCurrentGradient.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/ElectricField.NetFramework.g.cs | 4 ++-- .../Quantities/ElectricInductance.NetFramework.g.cs | 4 ++-- .../Quantities/ElectricPotential.NetFramework.g.cs | 4 ++-- .../Quantities/ElectricPotentialAc.NetFramework.g.cs | 4 ++-- .../Quantities/ElectricPotentialDc.NetFramework.g.cs | 4 ++-- .../Quantities/ElectricResistance.NetFramework.g.cs | 4 ++-- .../Quantities/ElectricResistivity.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs | 4 ++-- .../Quantities/ForceChangeRate.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs | 4 ++-- .../Quantities/HeatTransferCoefficient.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/Illuminance.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/Information.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/Irradiance.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/Irradiation.NetFramework.g.cs | 4 ++-- .../Quantities/KinematicViscosity.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs | 4 ++-- .../Quantities/LuminousIntensity.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/MagneticField.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/Magnetization.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs | 4 ++-- .../Quantities/MassMomentOfInertia.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/Permeability.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/Permittivity.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs | 4 ++-- .../Quantities/PressureChangeRate.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs | 4 ++-- .../Quantities/RotationalAcceleration.NetFramework.g.cs | 4 ++-- .../Quantities/RotationalSpeed.NetFramework.g.cs | 4 ++-- .../Quantities/RotationalStiffness.NetFramework.g.cs | 4 ++-- .../Quantities/RotationalStiffnessPerLength.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs | 4 ++-- .../Quantities/SpecificEntropy.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/Temperature.NetFramework.g.cs | 4 ++-- .../Quantities/TemperatureChangeRate.NetFramework.g.cs | 4 ++-- .../Quantities/TemperatureDelta.NetFramework.g.cs | 4 ++-- .../Quantities/ThermalConductivity.NetFramework.g.cs | 4 ++-- .../Quantities/ThermalResistance.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs | 4 ++-- .../GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs | 4 ++-- UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 | 4 ++-- 91 files changed, 182 insertions(+), 182 deletions(-) diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index 1ea5fc30f9..33e7b6026f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -850,10 +850,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index 6ee6e84dfd..436693f743 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -882,10 +882,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index 0d74b27c55..05b49f69f9 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -714,10 +714,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index dbc8379537..339307d4d3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -866,10 +866,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index 2f529750b8..86ba80c73d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -690,10 +690,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index 033d38e8b2..0c9e1ba0b3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -706,10 +706,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index 8b7ecbfd00..495a13abdc 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -850,10 +850,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index c6a7ce73b0..fde6a42500 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -658,10 +658,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index 19456c947f..1ca5b83403 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -738,10 +738,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index b71efa0c42..d8eb713c7b 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -1061,10 +1061,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index d169403a21..96ff6598a1 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -690,10 +690,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index 26f04eee65..a57adb0b47 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -757,10 +757,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs index 841c6410b7..eee35555f4 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs @@ -690,10 +690,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index 65b5d23ae2..a82621cc54 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -1269,10 +1269,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index 35d9304e0a..4bc22a2f5d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -802,10 +802,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index 40b09d1225..5854fa909d 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -741,10 +741,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index 980d06829f..763adb5ef9 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -706,10 +706,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index 65c74a6872..acdf4ecf55 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -661,10 +661,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index a7190559c2..ba39e8547f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -661,10 +661,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index 8c82900678..354123e2a4 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -693,10 +693,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index d3f4921c7f..877b25e3fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -661,10 +661,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index dfcb85f85f..a1cc308b07 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -770,10 +770,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index 4b346091be..ecb0264a02 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -661,10 +661,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index 46555395f7..4a1375f4a7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -658,10 +658,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index 1cbe1bb543..62d59ed1e2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -661,10 +661,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index c4706d4dd2..1444ead7db 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -709,10 +709,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index 10226aa8ac..cd77f0e425 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -722,10 +722,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index 71bf2320dc..9fd35283d7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -722,10 +722,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index 0ee84ef116..6027b85d08 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -722,10 +722,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index 24cd27d3e5..9e725b5e04 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -722,10 +722,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index 1b97d50eed..c38e4143b7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -869,10 +869,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index 2068ab720e..70cca0572e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -994,10 +994,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index 5607ee27b5..3cbeea5fae 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -754,10 +754,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index 7c97013271..40e33230fc 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -850,10 +850,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index d0cc8ff831..f8403706cc 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -818,10 +818,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index 94e77ea4b7..63333d8127 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -786,10 +786,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index 39d0657bcd..7e0eb9ea5d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -770,10 +770,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index 82535b30a8..66216844ce 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -930,10 +930,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index ff9b6cfe37..92ff716077 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -674,10 +674,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index f7b9d9df65..6ba65afdf4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -709,10 +709,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index 85dd13a73a..1b4eda250e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -1058,10 +1058,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index 3396c95e50..fbe983acfd 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -866,10 +866,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index 31d462e831..8a2353219b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -709,10 +709,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index 1bd4d33c7c..2a99f86bdf 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -773,10 +773,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index a5f9e4a77c..63594340e3 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -658,10 +658,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index 5543013fd7..5af19cf61e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -994,10 +994,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index dfac2ab278..1ab8af5748 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -682,10 +682,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index 98845fb484..93b828d110 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -693,10 +693,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index 6fa8b8de19..c55559f8bb 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -661,10 +661,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index 225cfa6654..b048d032d4 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -661,10 +661,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index 2b72e7e7e6..915fba99c6 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -709,10 +709,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index c222d5fd8a..a28ae73917 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -661,10 +661,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index 6a16a2bec9..8df5678d3c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -661,10 +661,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index 6e2ad4a2cb..ad364c00ef 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -1010,10 +1010,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index dace17739d..f01cbba707 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -1138,10 +1138,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index b094dcc1a8..5e8b0e47e2 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -674,10 +674,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index c37a71cda1..2f6336608c 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -1090,10 +1090,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index 1c16010643..526160138e 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -690,10 +690,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index f7ee6b5b5e..5f073f0720 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -690,10 +690,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index 1410910a10..43b1f77ebe 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -834,10 +834,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index 6ad8a8b718..0a2a62b5d6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -773,10 +773,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index c57d52c14a..df691b6fe2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -661,10 +661,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index 5b327ba128..d9647ff19e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -661,10 +661,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index 7a3adc1905..3e4a8d7307 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -962,10 +962,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index 71451b2a5d..492215127f 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -1346,10 +1346,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index edc0b0acda..a74be3f8ba 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -682,10 +682,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index 28fced282c..9deb1b7ed2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -1314,10 +1314,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index 82f06570da..5902af0991 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -754,10 +754,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index 906f974c2a..62cb365cf6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -738,10 +738,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index 71e784c012..0bf0d8de7a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -690,10 +690,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index b450731d1f..8bf7f43d24 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -706,10 +706,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index 070a4c275a..dbd6dac5a3 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -690,10 +690,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index 772299b7a1..5fbf1a624a 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -850,10 +850,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index 8f562244d2..5172d0877d 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -690,10 +690,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index d6f9d3248a..e0e58fadb7 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -690,10 +690,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index 17ba1c32b0..b0fc975793 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -661,10 +661,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index fca871b9c4..8974e637ac 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -789,10 +789,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index 29b9eaf29a..7bae70a5fe 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -770,10 +770,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index dbfeaa029b..02cf9bc417 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -690,10 +690,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index ee04bffd20..8fd3ebefa7 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -917,10 +917,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index 4471c67ae6..d5d9a7d25a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -1154,10 +1154,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index 64a260d73a..4e3ea7eefd 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -731,10 +731,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index dcb13ea71f..ea26db6c0f 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -802,10 +802,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index 413d8ba592..1e2ca21846 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -770,10 +770,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index 4fd9c89831..b88bc8a274 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -677,10 +677,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index 6df689c67a..1dccffec4e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -722,10 +722,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index 9852864b86..9f64122393 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -978,10 +978,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index 80d21210fe..a8e5855b2f 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -658,10 +658,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index 5c982d01ea..2a739327f5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -1362,10 +1362,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index 8b007804aa..fc16b7fdb9 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -1410,10 +1410,10 @@ public string ToString(string format, IFormatProvider formatProvider) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index 31f73908e4..d6a7ae4006 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -211,10 +211,10 @@ if ($obsoleteAttribute) int digits = 0; string formatString = format; - if(string.IsNullOrWhiteSpace(formatString)) + if(string.IsNullOrEmpty(formatString)) formatString = "G"; - formatString = formatString.ToUpper(); + formatString = formatString.ToUpperInvariant(); if(formatString.StartsWith("A") || formatString.StartsWith("S")) { From 4dc61254694ad8e94e69a43dd59be8cfca5606b3 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Mon, 18 Feb 2019 14:30:02 -0500 Subject: [PATCH 08/21] Adding U format string for unit --- UnitsNet.Tests/QuantityIFormattableTests.cs | 7 +++++++ .../Quantities/Acceleration.NetFramework.g.cs | 2 ++ .../Quantities/AmountOfSubstance.NetFramework.g.cs | 2 ++ .../Quantities/AmplitudeRatio.NetFramework.g.cs | 2 ++ UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs | 2 ++ .../Quantities/ApparentEnergy.NetFramework.g.cs | 2 ++ .../Quantities/ApparentPower.NetFramework.g.cs | 2 ++ UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs | 2 ++ .../Quantities/AreaMomentOfInertia.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/BitRate.NetFramework.g.cs | 2 ++ .../BrakeSpecificFuelConsumption.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/Capacitance.NetFramework.g.cs | 2 ++ .../CoefficientOfThermalExpansion.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/Density.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/Duration.NetFramework.g.cs | 2 ++ .../Quantities/DynamicViscosity.NetFramework.g.cs | 2 ++ .../Quantities/ElectricAdmittance.NetFramework.g.cs | 2 ++ .../Quantities/ElectricCharge.NetFramework.g.cs | 2 ++ .../Quantities/ElectricChargeDensity.NetFramework.g.cs | 2 ++ .../Quantities/ElectricConductance.NetFramework.g.cs | 2 ++ .../Quantities/ElectricConductivity.NetFramework.g.cs | 2 ++ .../Quantities/ElectricCurrent.NetFramework.g.cs | 2 ++ .../Quantities/ElectricCurrentDensity.NetFramework.g.cs | 2 ++ .../Quantities/ElectricCurrentGradient.NetFramework.g.cs | 2 ++ .../Quantities/ElectricField.NetFramework.g.cs | 2 ++ .../Quantities/ElectricInductance.NetFramework.g.cs | 2 ++ .../Quantities/ElectricPotential.NetFramework.g.cs | 2 ++ .../Quantities/ElectricPotentialAc.NetFramework.g.cs | 2 ++ .../Quantities/ElectricPotentialDc.NetFramework.g.cs | 2 ++ .../Quantities/ElectricResistance.NetFramework.g.cs | 2 ++ .../Quantities/ElectricResistivity.NetFramework.g.cs | 2 ++ UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/Entropy.NetFramework.g.cs | 2 ++ UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs | 2 ++ .../Quantities/ForceChangeRate.NetFramework.g.cs | 2 ++ .../Quantities/ForcePerLength.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/Frequency.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs | 2 ++ .../Quantities/HeatTransferCoefficient.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/Illuminance.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/Information.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/Irradiance.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/Irradiation.NetFramework.g.cs | 2 ++ .../Quantities/KinematicViscosity.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/LapseRate.NetFramework.g.cs | 2 ++ UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs | 2 ++ UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs | 2 ++ .../Quantities/LinearDensity.NetFramework.g.cs | 2 ++ .../Quantities/LuminousFlux.NetFramework.g.cs | 2 ++ .../Quantities/LuminousIntensity.NetFramework.g.cs | 2 ++ .../Quantities/MagneticField.NetFramework.g.cs | 2 ++ .../Quantities/MagneticFlux.NetFramework.g.cs | 2 ++ .../Quantities/Magnetization.NetFramework.g.cs | 2 ++ UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/MassFlow.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/MassFlux.NetFramework.g.cs | 2 ++ .../Quantities/MassMomentOfInertia.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs | 2 ++ .../Quantities/MolarEntropy.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/MolarMass.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/Molarity.NetFramework.g.cs | 2 ++ .../Quantities/Permeability.NetFramework.g.cs | 2 ++ .../Quantities/Permittivity.NetFramework.g.cs | 2 ++ UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs | 2 ++ .../Quantities/PowerDensity.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/Pressure.NetFramework.g.cs | 2 ++ .../Quantities/PressureChangeRate.NetFramework.g.cs | 2 ++ UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs | 2 ++ .../Quantities/ReactiveEnergy.NetFramework.g.cs | 2 ++ .../Quantities/ReactivePower.NetFramework.g.cs | 2 ++ .../Quantities/RotationalAcceleration.NetFramework.g.cs | 2 ++ .../Quantities/RotationalSpeed.NetFramework.g.cs | 2 ++ .../Quantities/RotationalStiffness.NetFramework.g.cs | 2 ++ .../RotationalStiffnessPerLength.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs | 2 ++ .../Quantities/SpecificEnergy.NetFramework.g.cs | 2 ++ .../Quantities/SpecificEntropy.NetFramework.g.cs | 2 ++ .../Quantities/SpecificVolume.NetFramework.g.cs | 2 ++ .../Quantities/SpecificWeight.NetFramework.g.cs | 2 ++ UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/Temperature.NetFramework.g.cs | 2 ++ .../Quantities/TemperatureChangeRate.NetFramework.g.cs | 2 ++ .../Quantities/TemperatureDelta.NetFramework.g.cs | 2 ++ .../Quantities/ThermalConductivity.NetFramework.g.cs | 2 ++ .../Quantities/ThermalResistance.NetFramework.g.cs | 2 ++ UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/VitaminA.NetFramework.g.cs | 2 ++ UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs | 2 ++ .../GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs | 2 ++ UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 | 2 ++ 92 files changed, 189 insertions(+) diff --git a/UnitsNet.Tests/QuantityIFormattableTests.cs b/UnitsNet.Tests/QuantityIFormattableTests.cs index 4dec7998bf..5eac0e1cd9 100644 --- a/UnitsNet.Tests/QuantityIFormattableTests.cs +++ b/UnitsNet.Tests/QuantityIFormattableTests.cs @@ -55,6 +55,12 @@ public void SFormatEqualsSignificantDigits() Assert.Equal(length.ToString(null, 5), length.ToString("S5")); } + [Fact] + public void UFormatEqualsUnitToString() + { + Assert.Equal(length.Unit.ToString(), length.ToString("U")); + } + [Fact] public void FormatStringsAreCaseInsensitive() { @@ -63,6 +69,7 @@ public void FormatStringsAreCaseInsensitive() Assert.Equal(length.ToString("v"), length.ToString("V")); Assert.Equal(length.ToString("q"), length.ToString("Q")); Assert.Equal(length.ToString("s"), length.ToString("S")); + Assert.Equal(length.ToString("u"), length.ToString("U")); } [Fact] diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index 33e7b6026f..cbe5e4f55b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -872,6 +872,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index 436693f743..4f725d13be 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -904,6 +904,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index 05b49f69f9..feab204935 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -736,6 +736,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index 339307d4d3..a6a71a2c94 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -888,6 +888,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index 86ba80c73d..1f2a46a371 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -712,6 +712,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index 0c9e1ba0b3..9e39cb882e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -728,6 +728,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index 495a13abdc..93e47dc9c2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -872,6 +872,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index fde6a42500..fb59d17375 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -680,6 +680,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index 1ca5b83403..98125aab09 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -760,6 +760,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index d8eb713c7b..d761a94cb8 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -1083,6 +1083,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index 96ff6598a1..86a40a80ab 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -712,6 +712,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index a57adb0b47..57ae60ee75 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -779,6 +779,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs index eee35555f4..585f7e1bd9 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs @@ -712,6 +712,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index a82621cc54..a7fabff770 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -1291,6 +1291,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index 4bc22a2f5d..79e7861ecd 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -824,6 +824,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index 5854fa909d..45380f25d1 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -763,6 +763,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index 763adb5ef9..138674e7f9 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -728,6 +728,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index acdf4ecf55..e965fc97c2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -683,6 +683,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index ba39e8547f..e8d451c6ff 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -683,6 +683,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index 354123e2a4..f01603bb28 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -715,6 +715,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index 877b25e3fa..30cb39357f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -683,6 +683,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index a1cc308b07..ced86ee093 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -792,6 +792,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index ecb0264a02..ac04132637 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -683,6 +683,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index 4a1375f4a7..b0b832907e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -680,6 +680,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index 62d59ed1e2..3fe8d226cc 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -683,6 +683,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index 1444ead7db..7758bcf5c8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -731,6 +731,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index cd77f0e425..16a846ea89 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -744,6 +744,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index 9fd35283d7..98d160cc0d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -744,6 +744,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index 6027b85d08..7b8448b6f1 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -744,6 +744,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index 9e725b5e04..23aea10f39 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -744,6 +744,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index c38e4143b7..4370757a90 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -891,6 +891,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index 70cca0572e..16693c6672 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -1016,6 +1016,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index 3cbeea5fae..0a4cb928e2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -776,6 +776,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index 40e33230fc..6a882a6d13 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -872,6 +872,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index f8403706cc..f7fb62a1db 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -840,6 +840,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index 63333d8127..b622c7a28c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -808,6 +808,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index 7e0eb9ea5d..0c1acbfc5d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -792,6 +792,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index 66216844ce..d36887e1f0 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -952,6 +952,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index 92ff716077..da53453dfb 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -696,6 +696,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index 6ba65afdf4..b986e519de 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -731,6 +731,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index 1b4eda250e..b760ec3ee9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -1080,6 +1080,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index fbe983acfd..ac4b73068c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -888,6 +888,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index 8a2353219b..8dc3ed039f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -731,6 +731,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index 2a99f86bdf..d1a8aaa70f 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -795,6 +795,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index 63594340e3..9ec569c8ba 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -680,6 +680,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index 5af19cf61e..2c289bbdf9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -1016,6 +1016,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index 1ab8af5748..a0cb69040f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -704,6 +704,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index 93b828d110..2353958692 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -715,6 +715,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index c55559f8bb..bb2eb08cea 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -683,6 +683,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index b048d032d4..a9dcc9a08a 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -683,6 +683,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index 915fba99c6..9f4cca3df9 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -731,6 +731,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index a28ae73917..f52503d978 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -683,6 +683,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index 8df5678d3c..00765e50dd 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -683,6 +683,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index ad364c00ef..b925916fa5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -1032,6 +1032,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index f01cbba707..ec150b28a5 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -1160,6 +1160,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index 5e8b0e47e2..b22314e8ed 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -696,6 +696,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index 2f6336608c..ead595e43c 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -1112,6 +1112,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index 526160138e..aa2a3657b0 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -712,6 +712,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index 5f073f0720..65fbdb326f 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -712,6 +712,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index 43b1f77ebe..496d4b3b6e 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -856,6 +856,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index 0a2a62b5d6..3ece36f1e5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -795,6 +795,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index df691b6fe2..14f308313b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -683,6 +683,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index d9647ff19e..07b59062e5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -683,6 +683,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index 3e4a8d7307..eef7d6b844 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -984,6 +984,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index 492215127f..cebbdbdcfe 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -1368,6 +1368,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index a74be3f8ba..cc166fb294 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -704,6 +704,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index 9deb1b7ed2..93686b8427 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -1336,6 +1336,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index 5902af0991..e754568e7d 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -776,6 +776,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index 62cb365cf6..ca9e638106 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -760,6 +760,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index 0bf0d8de7a..028135e416 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -712,6 +712,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index 8bf7f43d24..2d649b08fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -728,6 +728,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index dbd6dac5a3..c67456375f 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -712,6 +712,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index 5fbf1a624a..acbd3a117d 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -872,6 +872,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index 5172d0877d..4edb97b28a 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -712,6 +712,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index e0e58fadb7..2f8b310614 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -712,6 +712,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index b0fc975793..9a756fad07 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -683,6 +683,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index 8974e637ac..1f789a7c74 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -811,6 +811,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index 7bae70a5fe..c525ad565f 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -792,6 +792,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index 02cf9bc417..5d1f8580b1 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -712,6 +712,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index 8fd3ebefa7..3a2f8e4da2 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -939,6 +939,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index d5d9a7d25a..a997e22895 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -1176,6 +1176,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index 4e3ea7eefd..b5b8d85842 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -753,6 +753,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index ea26db6c0f..fcdffea076 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -824,6 +824,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index 1e2ca21846..d2831baabd 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -792,6 +792,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index b88bc8a274..822e16cfa5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -699,6 +699,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index 1dccffec4e..59ff89afa7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -744,6 +744,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index 9f64122393..8ea8c9539a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -1000,6 +1000,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index a8e5855b2f..6522d64546 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -680,6 +680,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index 2a739327f5..bfa730fb2c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -1384,6 +1384,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index fc16b7fdb9..e9644dd969 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -1432,6 +1432,8 @@ public string ToString(string format, IFormatProvider formatProvider) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index d6a7ae4006..f21e032b41 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -233,6 +233,8 @@ if ($obsoleteAttribute) return abbreviations[digits]; case "V": return Value.ToString(formatProvider); + case "U": + return Unit.ToString(); case "Q": return Info.Name; case "S": From da009f6763b29d804bbe5ad1d55b382456cb0320 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Mon, 18 Feb 2019 14:34:07 -0500 Subject: [PATCH 09/21] String can only be null/empty now --- UnitsNet.Tests/QuantityIFormattableTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/UnitsNet.Tests/QuantityIFormattableTests.cs b/UnitsNet.Tests/QuantityIFormattableTests.cs index 5eac0e1cd9..18c67794e4 100644 --- a/UnitsNet.Tests/QuantityIFormattableTests.cs +++ b/UnitsNet.Tests/QuantityIFormattableTests.cs @@ -19,7 +19,6 @@ public void EmptyOrNullFormatStringEqualsGFormat() { Assert.Equal(length.ToString("G"), length.ToString(string.Empty)); Assert.Equal(length.ToString("G"), length.ToString((string)null)); - Assert.Equal(length.ToString("G"), length.ToString(" ")); } [Fact] From d6df77ff8b5c2dbe8bf83616e736a373a6a34d5a Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Mon, 25 Feb 2019 15:02:23 -0500 Subject: [PATCH 10/21] Pull IFormattable code into QuantityFormatter --- .../Quantities/Acceleration.NetFramework.g.cs | 37 +--------- .../AmountOfSubstance.NetFramework.g.cs | 37 +--------- .../AmplitudeRatio.NetFramework.g.cs | 37 +--------- .../Quantities/Angle.NetFramework.g.cs | 37 +--------- .../ApparentEnergy.NetFramework.g.cs | 37 +--------- .../ApparentPower.NetFramework.g.cs | 37 +--------- .../Quantities/Area.NetFramework.g.cs | 37 +--------- .../Quantities/AreaDensity.NetFramework.g.cs | 37 +--------- .../AreaMomentOfInertia.NetFramework.g.cs | 37 +--------- .../Quantities/BitRate.NetFramework.g.cs | 37 +--------- ...eSpecificFuelConsumption.NetFramework.g.cs | 37 +--------- .../Quantities/Capacitance.NetFramework.g.cs | 37 +--------- ...icientOfThermalExpansion.NetFramework.g.cs | 37 +--------- .../Quantities/Density.NetFramework.g.cs | 37 +--------- .../Quantities/Duration.NetFramework.g.cs | 37 +--------- .../DynamicViscosity.NetFramework.g.cs | 37 +--------- .../ElectricAdmittance.NetFramework.g.cs | 37 +--------- .../ElectricCharge.NetFramework.g.cs | 37 +--------- .../ElectricChargeDensity.NetFramework.g.cs | 37 +--------- .../ElectricConductance.NetFramework.g.cs | 37 +--------- .../ElectricConductivity.NetFramework.g.cs | 37 +--------- .../ElectricCurrent.NetFramework.g.cs | 37 +--------- .../ElectricCurrentDensity.NetFramework.g.cs | 37 +--------- .../ElectricCurrentGradient.NetFramework.g.cs | 37 +--------- .../ElectricField.NetFramework.g.cs | 37 +--------- .../ElectricInductance.NetFramework.g.cs | 37 +--------- .../ElectricPotential.NetFramework.g.cs | 37 +--------- .../ElectricPotentialAc.NetFramework.g.cs | 37 +--------- .../ElectricPotentialDc.NetFramework.g.cs | 37 +--------- .../ElectricResistance.NetFramework.g.cs | 37 +--------- .../ElectricResistivity.NetFramework.g.cs | 37 +--------- .../Quantities/Energy.NetFramework.g.cs | 37 +--------- .../Quantities/Entropy.NetFramework.g.cs | 37 +--------- .../Quantities/Force.NetFramework.g.cs | 37 +--------- .../ForceChangeRate.NetFramework.g.cs | 37 +--------- .../ForcePerLength.NetFramework.g.cs | 37 +--------- .../Quantities/Frequency.NetFramework.g.cs | 37 +--------- .../Quantities/HeatFlux.NetFramework.g.cs | 37 +--------- .../HeatTransferCoefficient.NetFramework.g.cs | 37 +--------- .../Quantities/Illuminance.NetFramework.g.cs | 37 +--------- .../Quantities/Information.NetFramework.g.cs | 37 +--------- .../Quantities/Irradiance.NetFramework.g.cs | 37 +--------- .../Quantities/Irradiation.NetFramework.g.cs | 37 +--------- .../KinematicViscosity.NetFramework.g.cs | 37 +--------- .../Quantities/LapseRate.NetFramework.g.cs | 37 +--------- .../Quantities/Length.NetFramework.g.cs | 37 +--------- .../Quantities/Level.NetFramework.g.cs | 37 +--------- .../LinearDensity.NetFramework.g.cs | 37 +--------- .../Quantities/LuminousFlux.NetFramework.g.cs | 37 +--------- .../LuminousIntensity.NetFramework.g.cs | 37 +--------- .../MagneticField.NetFramework.g.cs | 37 +--------- .../Quantities/MagneticFlux.NetFramework.g.cs | 37 +--------- .../Magnetization.NetFramework.g.cs | 37 +--------- .../Quantities/Mass.NetFramework.g.cs | 37 +--------- .../Quantities/MassFlow.NetFramework.g.cs | 37 +--------- .../Quantities/MassFlux.NetFramework.g.cs | 37 +--------- .../MassMomentOfInertia.NetFramework.g.cs | 37 +--------- .../Quantities/MolarEnergy.NetFramework.g.cs | 37 +--------- .../Quantities/MolarEntropy.NetFramework.g.cs | 37 +--------- .../Quantities/MolarMass.NetFramework.g.cs | 37 +--------- .../Quantities/Molarity.NetFramework.g.cs | 37 +--------- .../Quantities/Permeability.NetFramework.g.cs | 37 +--------- .../Quantities/Permittivity.NetFramework.g.cs | 37 +--------- .../Quantities/Power.NetFramework.g.cs | 37 +--------- .../Quantities/PowerDensity.NetFramework.g.cs | 37 +--------- .../Quantities/PowerRatio.NetFramework.g.cs | 37 +--------- .../Quantities/Pressure.NetFramework.g.cs | 37 +--------- .../PressureChangeRate.NetFramework.g.cs | 37 +--------- .../Quantities/Ratio.NetFramework.g.cs | 37 +--------- .../ReactiveEnergy.NetFramework.g.cs | 37 +--------- .../ReactivePower.NetFramework.g.cs | 37 +--------- .../RotationalAcceleration.NetFramework.g.cs | 37 +--------- .../RotationalSpeed.NetFramework.g.cs | 37 +--------- .../RotationalStiffness.NetFramework.g.cs | 37 +--------- ...tionalStiffnessPerLength.NetFramework.g.cs | 37 +--------- .../Quantities/SolidAngle.NetFramework.g.cs | 37 +--------- .../SpecificEnergy.NetFramework.g.cs | 37 +--------- .../SpecificEntropy.NetFramework.g.cs | 37 +--------- .../SpecificVolume.NetFramework.g.cs | 37 +--------- .../SpecificWeight.NetFramework.g.cs | 37 +--------- .../Quantities/Speed.NetFramework.g.cs | 37 +--------- .../Quantities/Temperature.NetFramework.g.cs | 37 +--------- .../TemperatureChangeRate.NetFramework.g.cs | 37 +--------- .../TemperatureDelta.NetFramework.g.cs | 37 +--------- .../ThermalConductivity.NetFramework.g.cs | 37 +--------- .../ThermalResistance.NetFramework.g.cs | 37 +--------- .../Quantities/Torque.NetFramework.g.cs | 37 +--------- .../Quantities/VitaminA.NetFramework.g.cs | 37 +--------- .../Quantities/Volume.NetFramework.g.cs | 37 +--------- .../Quantities/VolumeFlow.NetFramework.g.cs | 37 +--------- UnitsNet/QuantityFormatter.cs | 70 +++++++++++++++++++ .../Include-GenerateQuantitySourceCode.ps1 | 37 +--------- 92 files changed, 161 insertions(+), 3276 deletions(-) create mode 100644 UnitsNet/QuantityFormatter.cs diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index cbe5e4f55b..4765a12bfe 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -845,42 +845,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index 4f725d13be..50ae182c1d 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -877,42 +877,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index feab204935..deec5ac8b7 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -709,42 +709,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index a6a71a2c94..6dba2f58c4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -861,42 +861,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index 1f2a46a371..ab81b7232f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -685,42 +685,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index 9e39cb882e..7356e6c273 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -701,42 +701,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index 93e47dc9c2..ec3546d9c1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -845,42 +845,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index fb59d17375..3dde0dbfe7 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -653,42 +653,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index 98125aab09..4b91c340a8 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -733,42 +733,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index c79e003081..e89782cbf8 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -1058,42 +1058,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index 86a40a80ab..19df540a91 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -685,42 +685,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index 57ae60ee75..6b3142e6f9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -752,42 +752,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs index 585f7e1bd9..baf5b372ab 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs @@ -685,42 +685,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index a7fabff770..cf060a6eae 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -1264,42 +1264,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index 79e7861ecd..8543b1b36a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -797,42 +797,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index 45380f25d1..b60ff1533b 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -736,42 +736,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index 138674e7f9..664bad60e4 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -701,42 +701,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index e965fc97c2..9fc86cb53c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -656,42 +656,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index e8d451c6ff..af1af77cf5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -656,42 +656,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index f01603bb28..f603ab4050 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -688,42 +688,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index 30cb39357f..247827c456 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -656,42 +656,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index ced86ee093..9de46691cd 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -765,42 +765,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index ac04132637..b8cce6770e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -656,42 +656,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index b0b832907e..4fec85c08a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -653,42 +653,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index 3fe8d226cc..330b63de52 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -656,42 +656,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index 7758bcf5c8..d5d06f6716 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -704,42 +704,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index 16a846ea89..0e117b6a20 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -717,42 +717,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index 98d160cc0d..ba5314dc4c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -717,42 +717,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index 7b8448b6f1..6344dd779c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -717,42 +717,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index 23aea10f39..4dac688860 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -717,42 +717,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index 4370757a90..896818bc7e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -864,42 +864,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index 00241cfcdf..703b0fc001 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -1005,42 +1005,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index 0a4cb928e2..07920ab30d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -749,42 +749,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index 6a882a6d13..c3a17e0208 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -845,42 +845,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index f7fb62a1db..86ce85f514 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -813,42 +813,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index b622c7a28c..3709ee6730 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -781,42 +781,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index c4fe9b16f0..eb7a2bfa4d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -781,42 +781,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index d36887e1f0..10451a32e2 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -925,42 +925,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index da53453dfb..9e0e16aeb3 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -669,42 +669,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index b986e519de..00d20af36b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -704,42 +704,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index 2a27924314..14c68032a3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -1055,42 +1055,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index ac4b73068c..48a94a50d7 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -861,42 +861,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index 27c2b3b2c1..8d5809e8e8 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -736,42 +736,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index d1a8aaa70f..58b5830d7a 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -768,42 +768,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index 9ec569c8ba..a8348739e9 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -653,42 +653,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index 2c289bbdf9..46cd3dcf10 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -989,42 +989,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index a0cb69040f..1538e67275 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -677,42 +677,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index 2353958692..ccb03f9b3a 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -688,42 +688,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index bb2eb08cea..637589fb93 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -656,42 +656,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index a9dcc9a08a..6682722244 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -656,42 +656,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index 9f4cca3df9..0e8ff408f1 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -704,42 +704,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index f52503d978..bf9a080838 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -656,42 +656,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index 00765e50dd..425256dc0c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -656,42 +656,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index b925916fa5..dd738cfe21 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -1005,42 +1005,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index ec150b28a5..99f30dc10e 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -1133,42 +1133,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index b22314e8ed..b4fbef93e3 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -669,42 +669,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index ead595e43c..aeb84e20a6 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -1085,42 +1085,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index aa2a3657b0..6ec9e41084 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -685,42 +685,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index 65fbdb326f..d44f0f2ac3 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -685,42 +685,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index 496d4b3b6e..548cc9d3de 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -829,42 +829,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index 3ece36f1e5..77d4e13e62 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -768,42 +768,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index 14f308313b..475d0cf6c7 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -656,42 +656,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index 07b59062e5..c2befadf5b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -656,42 +656,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index 2dbd737c28..86787cf15f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -959,42 +959,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index cebbdbdcfe..f5e7145a56 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -1341,42 +1341,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index cc166fb294..4605eba570 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -677,42 +677,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index 93686b8427..b3c4c0930e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -1309,42 +1309,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index e754568e7d..9b25e0ba97 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -749,42 +749,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index ca9e638106..b2b8637c1b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -733,42 +733,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index 028135e416..774941c45c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -685,42 +685,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index 2d649b08fa..893633bb20 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -701,42 +701,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index c67456375f..ca78f4cdea 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -685,42 +685,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index acbd3a117d..5b994def1b 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -845,42 +845,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index 4edb97b28a..5e7dcf915b 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -685,42 +685,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index 2f8b310614..92d3be2d3b 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -685,42 +685,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index 9a756fad07..8b69ee6e6b 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -656,42 +656,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index 1f789a7c74..d6e5144886 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -784,42 +784,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index c525ad565f..6e7e51ee18 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -765,42 +765,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index 5d1f8580b1..fd5dc71d83 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -685,42 +685,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index 3a2f8e4da2..50d085620b 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -912,42 +912,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index a997e22895..2c4c65e44d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -1149,42 +1149,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index b5b8d85842..65ff60a456 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -726,42 +726,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index fcdffea076..b85f09cccc 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -797,42 +797,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index d2831baabd..24689f038b 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -765,42 +765,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index 822e16cfa5..66ff46e074 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -672,42 +672,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index 59ff89afa7..b45b66bd34 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -717,42 +717,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index 8ea8c9539a..0dc7e25557 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -973,42 +973,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index 6522d64546..6f99d0b02e 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -653,42 +653,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index bfa730fb2c..3a4a4251aa 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -1357,42 +1357,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index e9644dd969..b09ea4854c 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -1405,42 +1405,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/QuantityFormatter.cs b/UnitsNet/QuantityFormatter.cs new file mode 100644 index 0000000000..7c5273635b --- /dev/null +++ b/UnitsNet/QuantityFormatter.cs @@ -0,0 +1,70 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +namespace UnitsNet +{ + public class QuantityFormatter + { + public static string Format(TQuantity quantity, string format, IFormatProvider formatProvider) + where TQuantity : IQuantity + where TUnitType : Enum + { + formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; + + var digits = 0; + var formatString = format; + + if(string.IsNullOrEmpty(formatString)) + formatString = "G"; + + formatString = formatString.ToUpperInvariant(); + + if(formatString.StartsWith("A") || formatString.StartsWith("S")) + { + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + throw new FormatException($"The {format} format string is not supported."); + + formatString = formatString.Substring(0, 1); + } + + switch(formatString) + { + case "G": + return quantity.ToString(formatProvider, 2); + case "A": + var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(quantity.Unit, formatProvider); + return abbreviations[digits]; + case "V": + return quantity.Value.ToString(formatProvider); + case "U": + return quantity.Unit.ToString(); + case "Q": + return quantity.QuantityInfo.Name; + case "S": + return quantity.ToString(formatProvider, digits); + default: + throw new FormatException($"The {format} format string is not supported."); + } + } + } +} diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index ab831ae619..d2cee22bf5 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -206,42 +206,7 @@ if ($obsoleteAttribute) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - - int digits = 0; - string formatString = format; - - if(string.IsNullOrEmpty(formatString)) - formatString = "G"; - - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) - { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) - throw new FormatException($"The {format} format string is not supported."); - - formatString = formatString.Substring(0, 1); - } - - switch(formatString) - { - case "G": - return ToString(formatProvider, 2); - case "A": - var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations<$unitEnumName>(Unit, formatProvider); - return abbreviations[digits]; - case "V": - return Value.ToString(formatProvider); - case "U": - return Unit.ToString(); - case "Q": - return Info.Name; - case "S": - return ToString(formatProvider, digits); - default: - throw new FormatException($"The {format} format string is not supported."); - } + return QuantityFormatter.Format<$quantityName, $unitEnumName>(this, format, formatProvider); } #endregion From 4f74384e9d856bcd8bc833a2d0d60d6c2d6aa805 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Mon, 25 Feb 2019 15:05:34 -0500 Subject: [PATCH 11/21] Simplify --- .../GeneratedCode/Quantities/Acceleration.NetFramework.g.cs | 3 +-- .../Quantities/AmountOfSubstance.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs | 3 +-- .../Quantities/AreaMomentOfInertia.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs | 3 +-- .../Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/Capacitance.NetFramework.g.cs | 3 +-- .../Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs | 3 +-- .../Quantities/DynamicViscosity.NetFramework.g.cs | 3 +-- .../Quantities/ElectricAdmittance.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs | 3 +-- .../Quantities/ElectricChargeDensity.NetFramework.g.cs | 3 +-- .../Quantities/ElectricConductance.NetFramework.g.cs | 3 +-- .../Quantities/ElectricConductivity.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs | 3 +-- .../Quantities/ElectricCurrentDensity.NetFramework.g.cs | 3 +-- .../Quantities/ElectricCurrentGradient.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/ElectricField.NetFramework.g.cs | 3 +-- .../Quantities/ElectricInductance.NetFramework.g.cs | 3 +-- .../Quantities/ElectricPotential.NetFramework.g.cs | 3 +-- .../Quantities/ElectricPotentialAc.NetFramework.g.cs | 3 +-- .../Quantities/ElectricPotentialDc.NetFramework.g.cs | 3 +-- .../Quantities/ElectricResistance.NetFramework.g.cs | 3 +-- .../Quantities/ElectricResistivity.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs | 3 +-- .../Quantities/HeatTransferCoefficient.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/Illuminance.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/Information.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/Irradiation.NetFramework.g.cs | 3 +-- .../Quantities/KinematicViscosity.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs | 3 +-- .../Quantities/LuminousIntensity.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/MagneticField.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/Magnetization.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs | 3 +-- .../Quantities/MassMomentOfInertia.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/Permeability.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/Permittivity.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs | 3 +-- .../Quantities/PressureChangeRate.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs | 3 +-- .../Quantities/RotationalAcceleration.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs | 3 +-- .../Quantities/RotationalStiffness.NetFramework.g.cs | 3 +-- .../Quantities/RotationalStiffnessPerLength.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs | 3 +-- .../GeneratedCode/Quantities/Temperature.NetFramework.g.cs | 3 +-- .../Quantities/TemperatureChangeRate.NetFramework.g.cs | 3 +-- .../Quantities/TemperatureDelta.NetFramework.g.cs | 3 +-- .../Quantities/ThermalConductivity.NetFramework.g.cs | 3 +-- .../Quantities/ThermalResistance.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs | 3 +-- UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs | 3 +-- UnitsNet/QuantityFormatter.cs | 3 +-- UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 | 3 +-- 92 files changed, 92 insertions(+), 184 deletions(-) diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index 4765a12bfe..cf64d9c0d3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -845,7 +844,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index 50ae182c1d..9135b5853c 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -877,7 +876,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index deec5ac8b7..f9283d6f5b 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -709,7 +708,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index 6dba2f58c4..0e52c6c2a2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -861,7 +860,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index ab81b7232f..aa7db99d4c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -685,7 +684,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index 7356e6c273..2f0caf5177 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -701,7 +700,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index ec3546d9c1..1502253543 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -845,7 +844,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index 3dde0dbfe7..d84b94f8ed 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -653,7 +652,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index 4b91c340a8..903828b7f7 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -733,7 +732,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index e89782cbf8..864fc6f460 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -1058,7 +1057,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index 19df540a91..249be79aaa 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -685,7 +684,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index 6b3142e6f9..ea5ea8c6b9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -752,7 +751,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs index baf5b372ab..e95fcc0d49 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -685,7 +684,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index cf060a6eae..05e20d9d16 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -1264,7 +1263,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index 8543b1b36a..e2c831e090 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -797,7 +796,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index b60ff1533b..43241ebcbe 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -736,7 +735,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index 664bad60e4..f2b2fcdb81 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -701,7 +700,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index 9fc86cb53c..715c0259ae 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -656,7 +655,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index af1af77cf5..b7be22319d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -656,7 +655,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index f603ab4050..44552e4f7b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -688,7 +687,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index 247827c456..631f174435 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -656,7 +655,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index 9de46691cd..bd1b7d5263 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -765,7 +764,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index b8cce6770e..260c680690 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -656,7 +655,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index 4fec85c08a..b61693d6c3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -653,7 +652,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index 330b63de52..5e380c5a3d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -656,7 +655,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index d5d06f6716..6c79a23db0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -704,7 +703,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index 0e117b6a20..875733eed8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -717,7 +716,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index ba5314dc4c..3d2e06c665 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -717,7 +716,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index 6344dd779c..e2d10aada8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -717,7 +716,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index 4dac688860..f3c058b32c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -717,7 +716,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index 896818bc7e..1b99f61962 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -864,7 +863,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index 703b0fc001..4286622f59 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -1005,7 +1004,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index 07920ab30d..c4d3b022b1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -749,7 +748,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index c3a17e0208..5defc0ce9c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -845,7 +844,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index 86ce85f514..0ef6a6f5f9 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -813,7 +812,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index 3709ee6730..cad2c58984 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -781,7 +780,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index eb7a2bfa4d..8928e16752 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -781,7 +780,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index 10451a32e2..1c323ba8d3 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -925,7 +924,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index 9e0e16aeb3..6c58c1c930 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -669,7 +668,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index 00d20af36b..7913437d85 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -704,7 +703,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index 14c68032a3..a90bcbba5d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -1055,7 +1054,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index 48a94a50d7..fb5ce353de 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -861,7 +860,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index 8d5809e8e8..fb39f63474 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -736,7 +735,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index 58b5830d7a..83f914a620 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -768,7 +767,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index a8348739e9..bea3890e03 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -653,7 +652,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index 46cd3dcf10..9a74732525 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -989,7 +988,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index 1538e67275..22e7f200b1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -677,7 +676,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index ccb03f9b3a..a391c8c62e 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -688,7 +687,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index 637589fb93..9b9d6cb475 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -656,7 +655,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index 6682722244..eb0939b6ba 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -656,7 +655,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index 0e8ff408f1..b0cbe39e6f 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -704,7 +703,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index bf9a080838..7594ff7b64 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -656,7 +655,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index 425256dc0c..4b0e0411db 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -656,7 +655,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index dd738cfe21..ba2a3554fe 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -1005,7 +1004,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index 99f30dc10e..4da891fd1e 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -1133,7 +1132,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index b4fbef93e3..8b96c5f14b 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -669,7 +668,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index aeb84e20a6..f33d5436a3 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -1085,7 +1084,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index 6ec9e41084..42fe816f6b 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -685,7 +684,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index d44f0f2ac3..1ae835f131 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -685,7 +684,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index 548cc9d3de..c6ce07018d 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -829,7 +828,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index 77d4e13e62..612015c681 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -768,7 +767,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index 475d0cf6c7..58af70cdc6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -656,7 +655,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index c2befadf5b..9533934a6e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -656,7 +655,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index 86787cf15f..77282bc81f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -959,7 +958,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index f5e7145a56..ddc6706b49 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -1341,7 +1340,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index 4605eba570..afcbd70317 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -677,7 +676,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index b3c4c0930e..99f66e69b9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -1309,7 +1308,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index 9b25e0ba97..92d6a4d701 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -749,7 +748,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index b2b8637c1b..46813fb2dd 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -733,7 +732,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index 774941c45c..8e9cde8cd5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -685,7 +684,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index 893633bb20..7f9617bcd2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -701,7 +700,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index ca78f4cdea..8a5fc20dd0 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -685,7 +684,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index 5b994def1b..c8eda5f3b1 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -845,7 +844,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index 5e7dcf915b..bfaeb4c960 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -685,7 +684,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index 92d3be2d3b..7a413e032a 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -685,7 +684,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index 8b69ee6e6b..824c43bf25 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -656,7 +655,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index d6e5144886..c3c8803e57 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -784,7 +783,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index 6e7e51ee18..ba4e973f42 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -765,7 +764,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index fd5dc71d83..97c0e68ef2 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -685,7 +684,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index 50d085620b..9727627829 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -912,7 +911,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index 2c4c65e44d..2d020c8650 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -1149,7 +1148,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index 65ff60a456..9e041dc13c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -726,7 +725,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index b85f09cccc..316103fab8 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -797,7 +796,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index 24689f038b..063dbdf22d 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -765,7 +764,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index 66ff46e074..c91d162a2f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -672,7 +671,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index b45b66bd34..f77cada5c8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -717,7 +716,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index 0dc7e25557..9136b45a6b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -973,7 +972,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index 6f99d0b02e..3762a7d5a3 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -653,7 +652,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index 3a4a4251aa..6fe0fa1649 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -1357,7 +1356,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index b09ea4854c..c48c08e5c6 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -36,7 +36,6 @@ // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -1405,7 +1404,7 @@ public string ToString(string format) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format(this, format, formatProvider); + return QuantityFormatter.Format(this, format, formatProvider); } #endregion diff --git a/UnitsNet/QuantityFormatter.cs b/UnitsNet/QuantityFormatter.cs index 7c5273635b..53c2b2416a 100644 --- a/UnitsNet/QuantityFormatter.cs +++ b/UnitsNet/QuantityFormatter.cs @@ -25,8 +25,7 @@ namespace UnitsNet { public class QuantityFormatter { - public static string Format(TQuantity quantity, string format, IFormatProvider formatProvider) - where TQuantity : IQuantity + public static string Format(IQuantity quantity, string format, IFormatProvider formatProvider) where TUnitType : Enum { formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index d2cee22bf5..e22874319a 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -58,7 +58,6 @@ function GenerateQuantitySourceCode([Quantity]$quantity) // THE SOFTWARE. using System; -using System.Globalization; using System.Linq; using JetBrains.Annotations; using UnitsNet.Units; @@ -206,7 +205,7 @@ if ($obsoleteAttribute) /// The string representation. public string ToString(string format, IFormatProvider formatProvider) { - return QuantityFormatter.Format<$quantityName, $unitEnumName>(this, format, formatProvider); + return QuantityFormatter.Format<$unitEnumName>(this, format, formatProvider); } #endregion From d75bc4db48558a73145c821a17e84ae72df9e036 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Mon, 25 Feb 2019 15:06:32 -0500 Subject: [PATCH 12/21] Rename variable --- UnitsNet/QuantityFormatter.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/UnitsNet/QuantityFormatter.cs b/UnitsNet/QuantityFormatter.cs index 53c2b2416a..e284fd5802 100644 --- a/UnitsNet/QuantityFormatter.cs +++ b/UnitsNet/QuantityFormatter.cs @@ -30,7 +30,7 @@ public static string Format(IQuantity quantity, string for { formatProvider = formatProvider ?? GlobalConfiguration.DefaultCulture; - var digits = 0; + var number = 0; var formatString = format; if(string.IsNullOrEmpty(formatString)) @@ -40,7 +40,7 @@ public static string Format(IQuantity quantity, string for if(formatString.StartsWith("A") || formatString.StartsWith("S")) { - if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out digits)) + if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out number)) throw new FormatException($"The {format} format string is not supported."); formatString = formatString.Substring(0, 1); @@ -52,7 +52,7 @@ public static string Format(IQuantity quantity, string for return quantity.ToString(formatProvider, 2); case "A": var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(quantity.Unit, formatProvider); - return abbreviations[digits]; + return abbreviations[number]; case "V": return quantity.Value.ToString(formatProvider); case "U": @@ -60,7 +60,7 @@ public static string Format(IQuantity quantity, string for case "Q": return quantity.QuantityInfo.Name; case "S": - return quantity.ToString(formatProvider, digits); + return quantity.ToString(formatProvider, number); default: throw new FormatException($"The {format} format string is not supported."); } From f15ab0b8f501879411c03fe4783447c618bae107 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Mon, 25 Feb 2019 15:16:01 -0500 Subject: [PATCH 13/21] Making format strings case sensitive and making all lower-case for now --- UnitsNet.Tests/QuantityIFormattableTests.cs | 45 +++++++------------ .../Quantities/Acceleration.NetFramework.g.cs | 2 +- .../AmountOfSubstance.NetFramework.g.cs | 2 +- .../AmplitudeRatio.NetFramework.g.cs | 2 +- .../Quantities/Angle.NetFramework.g.cs | 2 +- .../ApparentEnergy.NetFramework.g.cs | 2 +- .../ApparentPower.NetFramework.g.cs | 2 +- .../Quantities/Area.NetFramework.g.cs | 2 +- .../Quantities/AreaDensity.NetFramework.g.cs | 2 +- .../AreaMomentOfInertia.NetFramework.g.cs | 2 +- .../Quantities/BitRate.NetFramework.g.cs | 2 +- ...eSpecificFuelConsumption.NetFramework.g.cs | 2 +- .../Quantities/Capacitance.NetFramework.g.cs | 2 +- ...icientOfThermalExpansion.NetFramework.g.cs | 2 +- .../Quantities/Density.NetFramework.g.cs | 2 +- .../Quantities/Duration.NetFramework.g.cs | 2 +- .../DynamicViscosity.NetFramework.g.cs | 2 +- .../ElectricAdmittance.NetFramework.g.cs | 2 +- .../ElectricCharge.NetFramework.g.cs | 2 +- .../ElectricChargeDensity.NetFramework.g.cs | 2 +- .../ElectricConductance.NetFramework.g.cs | 2 +- .../ElectricConductivity.NetFramework.g.cs | 2 +- .../ElectricCurrent.NetFramework.g.cs | 2 +- .../ElectricCurrentDensity.NetFramework.g.cs | 2 +- .../ElectricCurrentGradient.NetFramework.g.cs | 2 +- .../ElectricField.NetFramework.g.cs | 2 +- .../ElectricInductance.NetFramework.g.cs | 2 +- .../ElectricPotential.NetFramework.g.cs | 2 +- .../ElectricPotentialAc.NetFramework.g.cs | 2 +- .../ElectricPotentialDc.NetFramework.g.cs | 2 +- .../ElectricResistance.NetFramework.g.cs | 2 +- .../ElectricResistivity.NetFramework.g.cs | 2 +- .../Quantities/Energy.NetFramework.g.cs | 2 +- .../Quantities/Entropy.NetFramework.g.cs | 2 +- .../Quantities/Force.NetFramework.g.cs | 2 +- .../ForceChangeRate.NetFramework.g.cs | 2 +- .../ForcePerLength.NetFramework.g.cs | 2 +- .../Quantities/Frequency.NetFramework.g.cs | 2 +- .../Quantities/HeatFlux.NetFramework.g.cs | 2 +- .../HeatTransferCoefficient.NetFramework.g.cs | 2 +- .../Quantities/Illuminance.NetFramework.g.cs | 2 +- .../Quantities/Information.NetFramework.g.cs | 2 +- .../Quantities/Irradiance.NetFramework.g.cs | 2 +- .../Quantities/Irradiation.NetFramework.g.cs | 2 +- .../KinematicViscosity.NetFramework.g.cs | 2 +- .../Quantities/LapseRate.NetFramework.g.cs | 2 +- .../Quantities/Length.NetFramework.g.cs | 2 +- .../Quantities/Level.NetFramework.g.cs | 2 +- .../LinearDensity.NetFramework.g.cs | 2 +- .../Quantities/LuminousFlux.NetFramework.g.cs | 2 +- .../LuminousIntensity.NetFramework.g.cs | 2 +- .../MagneticField.NetFramework.g.cs | 2 +- .../Quantities/MagneticFlux.NetFramework.g.cs | 2 +- .../Magnetization.NetFramework.g.cs | 2 +- .../Quantities/Mass.NetFramework.g.cs | 2 +- .../Quantities/MassFlow.NetFramework.g.cs | 2 +- .../Quantities/MassFlux.NetFramework.g.cs | 2 +- .../MassMomentOfInertia.NetFramework.g.cs | 2 +- .../Quantities/MolarEnergy.NetFramework.g.cs | 2 +- .../Quantities/MolarEntropy.NetFramework.g.cs | 2 +- .../Quantities/MolarMass.NetFramework.g.cs | 2 +- .../Quantities/Molarity.NetFramework.g.cs | 2 +- .../Quantities/Permeability.NetFramework.g.cs | 2 +- .../Quantities/Permittivity.NetFramework.g.cs | 2 +- .../Quantities/Power.NetFramework.g.cs | 2 +- .../Quantities/PowerDensity.NetFramework.g.cs | 2 +- .../Quantities/PowerRatio.NetFramework.g.cs | 2 +- .../Quantities/Pressure.NetFramework.g.cs | 2 +- .../PressureChangeRate.NetFramework.g.cs | 2 +- .../Quantities/Ratio.NetFramework.g.cs | 2 +- .../ReactiveEnergy.NetFramework.g.cs | 2 +- .../ReactivePower.NetFramework.g.cs | 2 +- .../RotationalAcceleration.NetFramework.g.cs | 2 +- .../RotationalSpeed.NetFramework.g.cs | 2 +- .../RotationalStiffness.NetFramework.g.cs | 2 +- ...tionalStiffnessPerLength.NetFramework.g.cs | 2 +- .../Quantities/SolidAngle.NetFramework.g.cs | 2 +- .../SpecificEnergy.NetFramework.g.cs | 2 +- .../SpecificEntropy.NetFramework.g.cs | 2 +- .../SpecificVolume.NetFramework.g.cs | 2 +- .../SpecificWeight.NetFramework.g.cs | 2 +- .../Quantities/Speed.NetFramework.g.cs | 2 +- .../Quantities/Temperature.NetFramework.g.cs | 2 +- .../TemperatureChangeRate.NetFramework.g.cs | 2 +- .../TemperatureDelta.NetFramework.g.cs | 2 +- .../ThermalConductivity.NetFramework.g.cs | 2 +- .../ThermalResistance.NetFramework.g.cs | 2 +- .../Quantities/Torque.NetFramework.g.cs | 2 +- .../Quantities/VitaminA.NetFramework.g.cs | 2 +- .../Quantities/Volume.NetFramework.g.cs | 2 +- .../Quantities/VolumeFlow.NetFramework.g.cs | 2 +- UnitsNet/QuantityFormatter.cs | 18 ++++---- .../Include-GenerateQuantitySourceCode.ps1 | 2 +- 93 files changed, 116 insertions(+), 129 deletions(-) diff --git a/UnitsNet.Tests/QuantityIFormattableTests.cs b/UnitsNet.Tests/QuantityIFormattableTests.cs index 18c67794e4..7d99c35134 100644 --- a/UnitsNet.Tests/QuantityIFormattableTests.cs +++ b/UnitsNet.Tests/QuantityIFormattableTests.cs @@ -11,70 +11,59 @@ public class QuantityIFormattableTests [Fact] public void GFormatStringEqualsToString() { - Assert.Equal(length.ToString("G"), length.ToString()); + Assert.Equal(length.ToString("g"), length.ToString()); } [Fact] public void EmptyOrNullFormatStringEqualsGFormat() { - Assert.Equal(length.ToString("G"), length.ToString(string.Empty)); - Assert.Equal(length.ToString("G"), length.ToString((string)null)); + Assert.Equal(length.ToString("g"), length.ToString(string.Empty)); + Assert.Equal(length.ToString("g"), length.ToString((string)null)); } [Fact] public void AFormatGetsAbbreviations() { - Assert.Equal(UnitAbbreviationsCache.Default.GetDefaultAbbreviation(length.Unit), length.ToString("A")); - Assert.Equal(UnitAbbreviationsCache.Default.GetDefaultAbbreviation(length.Unit), length.ToString("A0")); + Assert.Equal(UnitAbbreviationsCache.Default.GetDefaultAbbreviation(length.Unit), length.ToString("a")); + Assert.Equal(UnitAbbreviationsCache.Default.GetDefaultAbbreviation(length.Unit), length.ToString("a0")); - Assert.Equal(UnitAbbreviationsCache.Default.GetUnitAbbreviations(length.Unit)[1], length.ToString("A1")); - Assert.Equal(UnitAbbreviationsCache.Default.GetUnitAbbreviations(length.Unit)[2], length.ToString("A2")); + Assert.Equal(UnitAbbreviationsCache.Default.GetUnitAbbreviations(length.Unit)[1], length.ToString("a1")); + Assert.Equal(UnitAbbreviationsCache.Default.GetUnitAbbreviations(length.Unit)[2], length.ToString("a2")); } [Fact] public void VFormatEqualsValueToString() { - Assert.Equal(length.Value.ToString(), length.ToString("V")); + Assert.Equal(length.Value.ToString(), length.ToString("v")); } [Fact] public void QFormatEqualsQuantityName() { - Assert.Equal(Length.Info.Name, length.ToString("Q")); + Assert.Equal(Length.Info.Name, length.ToString("q")); } [Fact] public void SFormatEqualsSignificantDigits() { - Assert.Equal(length.ToString(null, 1), length.ToString("S")); - Assert.Equal(length.ToString(null, 1), length.ToString("S1")); - Assert.Equal(length.ToString(null, 2), length.ToString("S2")); - Assert.Equal(length.ToString(null, 3), length.ToString("S3")); - Assert.Equal(length.ToString(null, 4), length.ToString("S4")); - Assert.Equal(length.ToString(null, 5), length.ToString("S5")); + Assert.Equal(length.ToString(null, 1), length.ToString("s")); + Assert.Equal(length.ToString(null, 1), length.ToString("s1")); + Assert.Equal(length.ToString(null, 2), length.ToString("s2")); + Assert.Equal(length.ToString(null, 3), length.ToString("s3")); + Assert.Equal(length.ToString(null, 4), length.ToString("s4")); + Assert.Equal(length.ToString(null, 5), length.ToString("s5")); } [Fact] public void UFormatEqualsUnitToString() { - Assert.Equal(length.Unit.ToString(), length.ToString("U")); - } - - [Fact] - public void FormatStringsAreCaseInsensitive() - { - Assert.Equal(length.ToString("g"), length.ToString("G")); - Assert.Equal(length.ToString("a"), length.ToString("A")); - Assert.Equal(length.ToString("v"), length.ToString("V")); - Assert.Equal(length.ToString("q"), length.ToString("Q")); - Assert.Equal(length.ToString("s"), length.ToString("S")); - Assert.Equal(length.ToString("u"), length.ToString("U")); + Assert.Equal(length.Unit.ToString(), length.ToString("u")); } [Fact] public void UnsupportedFormatStringThrowsException() { - Assert.Throws(() => length.ToString("Z")); + Assert.Throws(() => length.ToString("z")); } } } diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index cf64d9c0d3..ce004a84e9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -781,7 +781,7 @@ private double AsBaseNumericType(AccelerationUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index 9135b5853c..091476b394 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -813,7 +813,7 @@ private double AsBaseNumericType(AmountOfSubstanceUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index f9283d6f5b..e3ab7e5aa2 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -645,7 +645,7 @@ private double AsBaseNumericType(AmplitudeRatioUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index 0e52c6c2a2..3720eddf18 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -797,7 +797,7 @@ private double AsBaseNumericType(AngleUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index aa7db99d4c..2eebe2f168 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(ApparentEnergyUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index 2f0caf5177..60a607b345 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -637,7 +637,7 @@ private double AsBaseNumericType(ApparentPowerUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index 1502253543..494c17b163 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -781,7 +781,7 @@ private double AsBaseNumericType(AreaUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index d84b94f8ed..17f11efe5b 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -589,7 +589,7 @@ private double AsBaseNumericType(AreaDensityUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index 903828b7f7..a8a6009d26 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -669,7 +669,7 @@ private double AsBaseNumericType(AreaMomentOfInertiaUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index 864fc6f460..b9b9ced682 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -994,7 +994,7 @@ private decimal AsBaseNumericType(BitRateUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index 249be79aaa..bf35f583cc 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(BrakeSpecificFuelConsumptionUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index ea5ea8c6b9..c6e3ec84da 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -688,7 +688,7 @@ private double AsBaseNumericType(CapacitanceUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs index e95fcc0d49..cd0c9cf0df 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(CoefficientOfThermalExpansionUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index 05e20d9d16..cd97f6dd00 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -1200,7 +1200,7 @@ private double AsBaseNumericType(DensityUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index e2c831e090..03f68a18a4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -733,7 +733,7 @@ private double AsBaseNumericType(DurationUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index 43241ebcbe..67eecbf09d 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -672,7 +672,7 @@ private double AsBaseNumericType(DynamicViscosityUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index f2b2fcdb81..a5cac7788c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -637,7 +637,7 @@ private double AsBaseNumericType(ElectricAdmittanceUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index 715c0259ae..72459b471b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(ElectricChargeUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index b7be22319d..5d73a1c0f9 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(ElectricChargeDensityUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index 44552e4f7b..95a4088114 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -624,7 +624,7 @@ private double AsBaseNumericType(ElectricConductanceUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index 631f174435..71c3db6a03 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(ElectricConductivityUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index bd1b7d5263..bdef2b09e0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -701,7 +701,7 @@ private double AsBaseNumericType(ElectricCurrentUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index 260c680690..e697b2594f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(ElectricCurrentDensityUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index b61693d6c3..164ea1f6f0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -589,7 +589,7 @@ private double AsBaseNumericType(ElectricCurrentGradientUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index 5e380c5a3d..5e0e3fd506 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(ElectricFieldUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index 6c79a23db0..dcce7d3f9f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -640,7 +640,7 @@ private double AsBaseNumericType(ElectricInductanceUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index 875733eed8..e37a257293 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -653,7 +653,7 @@ private double AsBaseNumericType(ElectricPotentialUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index 3d2e06c665..778665c2a3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -653,7 +653,7 @@ private double AsBaseNumericType(ElectricPotentialAcUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index e2d10aada8..7f705ebb5a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -653,7 +653,7 @@ private double AsBaseNumericType(ElectricPotentialDcUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index f3c058b32c..0c235c8159 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -653,7 +653,7 @@ private double AsBaseNumericType(ElectricResistanceUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index 1b99f61962..a77cab175e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -800,7 +800,7 @@ private double AsBaseNumericType(ElectricResistivityUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index 4286622f59..135b9e1054 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -941,7 +941,7 @@ private double AsBaseNumericType(EnergyUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index c4d3b022b1..5e70472def 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -685,7 +685,7 @@ private double AsBaseNumericType(EntropyUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index 5defc0ce9c..010dca257e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -781,7 +781,7 @@ private double AsBaseNumericType(ForceUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index 0ef6a6f5f9..cf6cfce5b3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -749,7 +749,7 @@ private double AsBaseNumericType(ForceChangeRateUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index cad2c58984..fec5a64a8a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -717,7 +717,7 @@ private double AsBaseNumericType(ForcePerLengthUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index 8928e16752..9dda8cfb07 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -717,7 +717,7 @@ private double AsBaseNumericType(FrequencyUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index 1c323ba8d3..5a300b20d2 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -861,7 +861,7 @@ private double AsBaseNumericType(HeatFluxUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index 6c58c1c930..351025ac05 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -605,7 +605,7 @@ private double AsBaseNumericType(HeatTransferCoefficientUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index 7913437d85..da0cf491f6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -640,7 +640,7 @@ private double AsBaseNumericType(IlluminanceUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index a90bcbba5d..fb55d7cdfe 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -991,7 +991,7 @@ private decimal AsBaseNumericType(InformationUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index fb5ce353de..8c03a89af4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -797,7 +797,7 @@ private double AsBaseNumericType(IrradianceUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index fb39f63474..3fdeb1b880 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -672,7 +672,7 @@ private double AsBaseNumericType(IrradiationUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index 83f914a620..10b148d0c0 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -704,7 +704,7 @@ private double AsBaseNumericType(KinematicViscosityUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index bea3890e03..ea12ffd629 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -589,7 +589,7 @@ private double AsBaseNumericType(LapseRateUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index 9a74732525..ee07cddcab 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -925,7 +925,7 @@ private double AsBaseNumericType(LengthUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index 22e7f200b1..ee7a8e111a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -613,7 +613,7 @@ private double AsBaseNumericType(LevelUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index a391c8c62e..ef8cb698de 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -624,7 +624,7 @@ private double AsBaseNumericType(LinearDensityUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index 9b9d6cb475..e0a8eea679 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(LuminousFluxUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index eb0939b6ba..e0bcc7049a 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(LuminousIntensityUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index b0cbe39e6f..a7bfd13593 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -640,7 +640,7 @@ private double AsBaseNumericType(MagneticFieldUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index 7594ff7b64..b81d8b16f9 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(MagneticFluxUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index 4b0e0411db..ad144b020b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(MagnetizationUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index ba2a3554fe..78e172e4f6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -941,7 +941,7 @@ private double AsBaseNumericType(MassUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index 4da891fd1e..3d0e9b6ce7 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -1069,7 +1069,7 @@ private double AsBaseNumericType(MassFlowUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index 8b96c5f14b..38cd9196c4 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -605,7 +605,7 @@ private double AsBaseNumericType(MassFluxUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index f33d5436a3..3166dc16da 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -1021,7 +1021,7 @@ private double AsBaseNumericType(MassMomentOfInertiaUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index 42fe816f6b..bdfc32d067 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(MolarEnergyUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index 1ae835f131..b186731338 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(MolarEntropyUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index c6ce07018d..057be3cc4c 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -765,7 +765,7 @@ private double AsBaseNumericType(MolarMassUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index 612015c681..aa28d7e072 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -704,7 +704,7 @@ private double AsBaseNumericType(MolarityUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index 58af70cdc6..8912d09346 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(PermeabilityUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index 9533934a6e..b1a940540f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(PermittivityUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index 77282bc81f..6a9e8e7253 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -895,7 +895,7 @@ private decimal AsBaseNumericType(PowerUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index ddc6706b49..89fd7d1459 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -1277,7 +1277,7 @@ private double AsBaseNumericType(PowerDensityUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index afcbd70317..5dde620686 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -613,7 +613,7 @@ private double AsBaseNumericType(PowerRatioUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index 99f66e69b9..9e27771cba 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -1245,7 +1245,7 @@ private double AsBaseNumericType(PressureUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index 92d6a4d701..886f003497 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -685,7 +685,7 @@ private double AsBaseNumericType(PressureChangeRateUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index 46813fb2dd..d9f91b0011 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -669,7 +669,7 @@ private double AsBaseNumericType(RatioUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index 8e9cde8cd5..de54642a19 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(ReactiveEnergyUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index 7f9617bcd2..7a75d71c81 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -637,7 +637,7 @@ private double AsBaseNumericType(ReactivePowerUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index 8a5fc20dd0..9316af3e0b 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(RotationalAccelerationUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index c8eda5f3b1..ab3b4c6d0e 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -781,7 +781,7 @@ private double AsBaseNumericType(RotationalSpeedUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index bfaeb4c960..e3a43c228e 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(RotationalStiffnessUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index 7a413e032a..e5d62e001f 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(RotationalStiffnessPerLengthUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index 824c43bf25..6aeec63b86 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(SolidAngleUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index c3c8803e57..fb5b08eee7 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -720,7 +720,7 @@ private double AsBaseNumericType(SpecificEnergyUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index ba4e973f42..f148314142 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -701,7 +701,7 @@ private double AsBaseNumericType(SpecificEntropyUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index 97c0e68ef2..507c084e5f 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(SpecificVolumeUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index 9727627829..62c37dfe60 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -848,7 +848,7 @@ private double AsBaseNumericType(SpecificWeightUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index 2d020c8650..758dbca84d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -1085,7 +1085,7 @@ private double AsBaseNumericType(SpeedUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index 9e041dc13c..b24c8e98b6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -662,7 +662,7 @@ private double AsBaseNumericType(TemperatureUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index 316103fab8..14972985c0 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -733,7 +733,7 @@ private double AsBaseNumericType(TemperatureChangeRateUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index 063dbdf22d..47b41a2810 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -701,7 +701,7 @@ private double AsBaseNumericType(TemperatureDeltaUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index c91d162a2f..b2c0d2ac1a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -608,7 +608,7 @@ private double AsBaseNumericType(ThermalConductivityUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index f77cada5c8..c3da8395d0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -653,7 +653,7 @@ private double AsBaseNumericType(ThermalResistanceUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index 9136b45a6b..f79552a39e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -909,7 +909,7 @@ private double AsBaseNumericType(TorqueUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index 3762a7d5a3..ed88e79dbc 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -589,7 +589,7 @@ private double AsBaseNumericType(VitaminAUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index 6fe0fa1649..f07bd5f5a1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -1293,7 +1293,7 @@ private double AsBaseNumericType(VolumeUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index c48c08e5c6..e26154b9c5 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -1341,7 +1341,7 @@ private double AsBaseNumericType(VolumeFlowUnit unit) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// diff --git a/UnitsNet/QuantityFormatter.cs b/UnitsNet/QuantityFormatter.cs index e284fd5802..11fc5d585c 100644 --- a/UnitsNet/QuantityFormatter.cs +++ b/UnitsNet/QuantityFormatter.cs @@ -34,11 +34,9 @@ public static string Format(IQuantity quantity, string for var formatString = format; if(string.IsNullOrEmpty(formatString)) - formatString = "G"; + formatString = "g"; - formatString = formatString.ToUpperInvariant(); - - if(formatString.StartsWith("A") || formatString.StartsWith("S")) + if(formatString.StartsWith("a") || formatString.StartsWith("s")) { if(formatString.Length > 1 && !int.TryParse(formatString.Substring(1), out number)) throw new FormatException($"The {format} format string is not supported."); @@ -48,18 +46,18 @@ public static string Format(IQuantity quantity, string for switch(formatString) { - case "G": + case "g": return quantity.ToString(formatProvider, 2); - case "A": + case "a": var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(quantity.Unit, formatProvider); return abbreviations[number]; - case "V": + case "v": return quantity.Value.ToString(formatProvider); - case "U": + case "u": return quantity.Unit.ToString(); - case "Q": + case "q": return quantity.QuantityInfo.Name; - case "S": + case "s": return quantity.ToString(formatProvider, number); default: throw new FormatException($"The {format} format string is not supported."); diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index e22874319a..0ff9cb38b9 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -142,7 +142,7 @@ if ($obsoleteAttribute) /// String representation. public override string ToString() { - return ToString("G"); + return ToString("g"); } /// From 7c669cf3d14a3e3fd8b0ffc0d696a9e04e17a20c Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Tue, 26 Feb 2019 08:38:28 -0500 Subject: [PATCH 14/21] Adding doc --- UnitsNet/QuantityFormatter.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/UnitsNet/QuantityFormatter.cs b/UnitsNet/QuantityFormatter.cs index 11fc5d585c..56dcb88023 100644 --- a/UnitsNet/QuantityFormatter.cs +++ b/UnitsNet/QuantityFormatter.cs @@ -20,11 +20,23 @@ // THE SOFTWARE. using System; +using UnitsNet.Units; namespace UnitsNet { + /// + /// The QuantityFormatter class is responsible for formatting a quantity using the given format string. + /// public class QuantityFormatter { + /// + /// Formats the given quantity using the given format string and format provider. + /// + /// The quantity's unit type, for example . + /// The quantity to format. + /// The format string. + /// The format provider to use for localization and number formatting. Defaults to if null. + /// The string representation. public static string Format(IQuantity quantity, string format, IFormatProvider formatProvider) where TUnitType : Enum { From b7a23c23ade989c45d149a5432a3f22e748db4ad Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Tue, 26 Feb 2019 08:54:29 -0500 Subject: [PATCH 15/21] Adding doc for valid format strings --- UnitsNet.Tests/QuantityIFormattableTests.cs | 4 ++-- .../Quantities/Acceleration.NetFramework.g.cs | 20 +++++++++++++++++++ .../AmountOfSubstance.NetFramework.g.cs | 20 +++++++++++++++++++ .../AmplitudeRatio.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Angle.NetFramework.g.cs | 20 +++++++++++++++++++ .../ApparentEnergy.NetFramework.g.cs | 20 +++++++++++++++++++ .../ApparentPower.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Area.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/AreaDensity.NetFramework.g.cs | 20 +++++++++++++++++++ .../AreaMomentOfInertia.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/BitRate.NetFramework.g.cs | 20 +++++++++++++++++++ ...eSpecificFuelConsumption.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Capacitance.NetFramework.g.cs | 20 +++++++++++++++++++ ...icientOfThermalExpansion.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Density.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Duration.NetFramework.g.cs | 20 +++++++++++++++++++ .../DynamicViscosity.NetFramework.g.cs | 20 +++++++++++++++++++ .../ElectricAdmittance.NetFramework.g.cs | 20 +++++++++++++++++++ .../ElectricCharge.NetFramework.g.cs | 20 +++++++++++++++++++ .../ElectricChargeDensity.NetFramework.g.cs | 20 +++++++++++++++++++ .../ElectricConductance.NetFramework.g.cs | 20 +++++++++++++++++++ .../ElectricConductivity.NetFramework.g.cs | 20 +++++++++++++++++++ .../ElectricCurrent.NetFramework.g.cs | 20 +++++++++++++++++++ .../ElectricCurrentDensity.NetFramework.g.cs | 20 +++++++++++++++++++ .../ElectricCurrentGradient.NetFramework.g.cs | 20 +++++++++++++++++++ .../ElectricField.NetFramework.g.cs | 20 +++++++++++++++++++ .../ElectricInductance.NetFramework.g.cs | 20 +++++++++++++++++++ .../ElectricPotential.NetFramework.g.cs | 20 +++++++++++++++++++ .../ElectricPotentialAc.NetFramework.g.cs | 20 +++++++++++++++++++ .../ElectricPotentialDc.NetFramework.g.cs | 20 +++++++++++++++++++ .../ElectricResistance.NetFramework.g.cs | 20 +++++++++++++++++++ .../ElectricResistivity.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Energy.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Entropy.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Force.NetFramework.g.cs | 20 +++++++++++++++++++ .../ForceChangeRate.NetFramework.g.cs | 20 +++++++++++++++++++ .../ForcePerLength.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Frequency.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/HeatFlux.NetFramework.g.cs | 20 +++++++++++++++++++ .../HeatTransferCoefficient.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Illuminance.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Information.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Irradiance.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Irradiation.NetFramework.g.cs | 20 +++++++++++++++++++ .../KinematicViscosity.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/LapseRate.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Length.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Level.NetFramework.g.cs | 20 +++++++++++++++++++ .../LinearDensity.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/LuminousFlux.NetFramework.g.cs | 20 +++++++++++++++++++ .../LuminousIntensity.NetFramework.g.cs | 20 +++++++++++++++++++ .../MagneticField.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/MagneticFlux.NetFramework.g.cs | 20 +++++++++++++++++++ .../Magnetization.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Mass.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/MassFlow.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/MassFlux.NetFramework.g.cs | 20 +++++++++++++++++++ .../MassMomentOfInertia.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/MolarEnergy.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/MolarEntropy.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/MolarMass.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Molarity.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Permeability.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Permittivity.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Power.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/PowerDensity.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/PowerRatio.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Pressure.NetFramework.g.cs | 20 +++++++++++++++++++ .../PressureChangeRate.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Ratio.NetFramework.g.cs | 20 +++++++++++++++++++ .../ReactiveEnergy.NetFramework.g.cs | 20 +++++++++++++++++++ .../ReactivePower.NetFramework.g.cs | 20 +++++++++++++++++++ .../RotationalAcceleration.NetFramework.g.cs | 20 +++++++++++++++++++ .../RotationalSpeed.NetFramework.g.cs | 20 +++++++++++++++++++ .../RotationalStiffness.NetFramework.g.cs | 20 +++++++++++++++++++ ...tionalStiffnessPerLength.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/SolidAngle.NetFramework.g.cs | 20 +++++++++++++++++++ .../SpecificEnergy.NetFramework.g.cs | 20 +++++++++++++++++++ .../SpecificEntropy.NetFramework.g.cs | 20 +++++++++++++++++++ .../SpecificVolume.NetFramework.g.cs | 20 +++++++++++++++++++ .../SpecificWeight.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Speed.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Temperature.NetFramework.g.cs | 20 +++++++++++++++++++ .../TemperatureChangeRate.NetFramework.g.cs | 20 +++++++++++++++++++ .../TemperatureDelta.NetFramework.g.cs | 20 +++++++++++++++++++ .../ThermalConductivity.NetFramework.g.cs | 20 +++++++++++++++++++ .../ThermalResistance.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Torque.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/VitaminA.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/Volume.NetFramework.g.cs | 20 +++++++++++++++++++ .../Quantities/VolumeFlow.NetFramework.g.cs | 20 +++++++++++++++++++ UnitsNet/QuantityFormatter.cs | 10 ++++++++++ .../Include-GenerateQuantitySourceCode.ps1 | 20 +++++++++++++++++++ 93 files changed, 1832 insertions(+), 2 deletions(-) diff --git a/UnitsNet.Tests/QuantityIFormattableTests.cs b/UnitsNet.Tests/QuantityIFormattableTests.cs index 7d99c35134..9836eb8f54 100644 --- a/UnitsNet.Tests/QuantityIFormattableTests.cs +++ b/UnitsNet.Tests/QuantityIFormattableTests.cs @@ -6,7 +6,7 @@ namespace UnitsNet.Tests { public class QuantityIFormattableTests { - private static Length length = Length.FromFeet(3.0); + private static Length length = Length.FromFeet(1.2345678); [Fact] public void GFormatStringEqualsToString() @@ -46,7 +46,7 @@ public void QFormatEqualsQuantityName() [Fact] public void SFormatEqualsSignificantDigits() { - Assert.Equal(length.ToString(null, 1), length.ToString("s")); + Assert.Equal(length.ToString(null, 0), length.ToString("s")); Assert.Equal(length.ToString(null, 1), length.ToString("s1")); Assert.Equal(length.ToString(null, 2), length.ToString("s2")); Assert.Equal(length.ToString(null, 3), length.ToString("s3")); diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index 5351b755ea..e8b7011df4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -836,6 +836,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -847,6 +857,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index 5833e1bbd3..f0f26da562 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -868,6 +868,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -879,6 +889,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index 8f7e75fa7e..b89867afda 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -700,6 +700,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -711,6 +721,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index ecb74239a1..c06863d899 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -852,6 +852,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -863,6 +873,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index c701cf7644..2547af38ac 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -676,6 +676,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -687,6 +697,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index e257378e5a..1bd2faf400 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -692,6 +692,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -703,6 +713,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index 9e30a5e3c4..a5fd944bfd 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -836,6 +836,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -847,6 +857,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index d23212b803..438298f9d1 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -644,6 +644,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -655,6 +665,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index 5949280922..e71caeced8 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -724,6 +724,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -735,6 +745,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index c64cce02d2..ce5c1abf7e 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -1049,6 +1049,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -1060,6 +1070,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index ab9e156d5e..efa2370368 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -676,6 +676,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -687,6 +697,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index 9593e1fd79..e0f5a79cdd 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -743,6 +743,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -754,6 +764,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs index 15d71d2591..49c8367962 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs @@ -676,6 +676,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -687,6 +697,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index 6574a7764e..fb4d395f1d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -1255,6 +1255,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -1266,6 +1276,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index dd98cbdd64..41e11f1f15 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -788,6 +788,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -799,6 +809,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index 7c971c4159..c6d3c33fe3 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -727,6 +727,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -738,6 +748,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index 67fbce2ef5..0b4b9e1a07 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -692,6 +692,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -703,6 +713,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index f6a6d41ae0..e92b2421c7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -647,6 +647,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -658,6 +668,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index b6263c92b4..47625a9bd5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -647,6 +647,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -658,6 +668,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index e06d161c30..71b0e1f611 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -679,6 +679,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -690,6 +700,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index a8626ba07c..564608c7a0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -647,6 +647,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -658,6 +668,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index cd65574ea1..0e043c1b2a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -756,6 +756,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -767,6 +777,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index 73475c38fc..123c1c4737 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -647,6 +647,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -658,6 +668,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index b3aff49c6e..0c11cc631f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -644,6 +644,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -655,6 +665,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index 09ae4017bf..361f94ed90 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -647,6 +647,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -658,6 +668,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index 85f5415214..d442e146a3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -695,6 +695,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -706,6 +716,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index 4f274b597a..21dcc9bfe2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -708,6 +708,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -719,6 +729,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index 2006d50188..c8a88c1d2a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -708,6 +708,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -719,6 +729,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index 36366743c4..e7af49db46 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -708,6 +708,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -719,6 +729,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index c34781e3d2..601f0bfa36 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -708,6 +708,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -719,6 +729,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index cbf2b70a96..dd845838c5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -855,6 +855,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -866,6 +876,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index f2735c3427..1abcce1d80 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -996,6 +996,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -1007,6 +1017,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index c5f41257a2..a010a95d3d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -740,6 +740,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -751,6 +761,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index 5af367e602..9940f62558 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -836,6 +836,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -847,6 +857,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index fadfb465d0..41e542c08f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -804,6 +804,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -815,6 +825,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index 9c10063efd..f44cfe5511 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -772,6 +772,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -783,6 +793,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index ec2e41c811..1ed66d83e4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -772,6 +772,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -783,6 +793,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index 54dd1904fd..055fa2f798 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -916,6 +916,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -927,6 +937,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index 5c3357e34e..491b880f9a 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -660,6 +660,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -671,6 +681,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index 9366b7ba8e..2c54fca706 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -695,6 +695,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -706,6 +716,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index 216847bd70..0827d9309b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -1046,6 +1046,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -1057,6 +1067,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index 3de506b83a..8e3a775efe 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -852,6 +852,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -863,6 +873,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index ab6a209a6f..a1d6301205 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -727,6 +727,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -738,6 +748,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index 6b4a79ced8..80b872dc16 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -759,6 +759,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -770,6 +780,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index c952c54502..155d93cfe6 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -644,6 +644,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -655,6 +665,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index 8dad14f184..b840db3468 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -980,6 +980,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -991,6 +1001,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index 06bebb615d..d576425ebe 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -668,6 +668,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -679,6 +689,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index 3d6bdb9c03..a51fd2c6e4 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -679,6 +679,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -690,6 +700,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index 8dce788202..4a4343f039 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -647,6 +647,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -658,6 +668,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index dc56bf8fb2..bbf086c1bc 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -647,6 +647,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -658,6 +668,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index 98a05a40f0..5d60fdfea0 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -695,6 +695,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -706,6 +716,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index 627a6fb1fa..12e2e597fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -647,6 +647,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -658,6 +668,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index c8576d4b9d..070d6b05d5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -647,6 +647,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -658,6 +668,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index a1c2da9145..c05232c781 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -996,6 +996,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -1007,6 +1017,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index 8bcb106374..d77d47ffe8 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -1124,6 +1124,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -1135,6 +1145,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index c17112dd30..dd22cbe9f8 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -660,6 +660,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -671,6 +681,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index ab48025ec0..9e0cc44d55 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -1076,6 +1076,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -1087,6 +1097,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index 7282eb20ca..9337339e74 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -676,6 +676,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -687,6 +697,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index 94f2fa9ea9..21f6adbb8a 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -676,6 +676,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -687,6 +697,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index caebde0746..744976db36 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -820,6 +820,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -831,6 +841,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index 7b0192f0ed..9aa6ec55b2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -759,6 +759,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -770,6 +780,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index 0fccf613ec..59d92be5ee 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -647,6 +647,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -658,6 +668,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index 1ade1f80b8..c45707ad6e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -647,6 +647,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -658,6 +668,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index 1ab6faff56..280380ed7a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -950,6 +950,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -961,6 +971,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index 28e84cf952..6c984636fe 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -1332,6 +1332,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -1343,6 +1353,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index e00772d921..c042bad01e 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -668,6 +668,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -679,6 +689,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index 4df742a520..5bc1500c53 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -1300,6 +1300,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -1311,6 +1321,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index 02e4684043..4872e7c8f3 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -740,6 +740,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -751,6 +761,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index 74401255e6..c58962fb93 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -724,6 +724,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -735,6 +745,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index 89e4fe84db..7bf32b6d58 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -676,6 +676,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -687,6 +697,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index bd9d9c45a2..69066db074 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -692,6 +692,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -703,6 +713,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index 22f29803df..ad7f4254d0 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -676,6 +676,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -687,6 +697,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index 8b418e220b..ebb7d7916c 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -836,6 +836,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -847,6 +857,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index b08a287a8c..0e9cab2f92 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -676,6 +676,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -687,6 +697,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index dc098ca7bb..20db480e5b 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -676,6 +676,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -687,6 +697,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index 1d668cd406..7a5f970f39 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -647,6 +647,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -658,6 +668,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index 0eefba89ff..cf2d499e55 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -775,6 +775,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -786,6 +796,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index ca25aab0c4..de858ca1f0 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -756,6 +756,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -767,6 +777,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index 4fb8ed8ec0..c628c8de1a 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -676,6 +676,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -687,6 +697,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index b3564e990f..5a4cf6d7bf 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -903,6 +903,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -914,6 +924,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index 4e7b498189..08f48ce0c5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -1140,6 +1140,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -1151,6 +1161,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index 227603a33e..5325ad5bc8 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -710,6 +710,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -721,6 +731,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index 07c5ff6203..cc56950217 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -788,6 +788,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -799,6 +809,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index f2c0bbebb4..d941d468f2 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -756,6 +756,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -767,6 +777,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index cafb263ec4..ea64096bec 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -663,6 +663,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -674,6 +684,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index 157c1ae3e7..836537cac2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -708,6 +708,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -719,6 +729,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index 2d545712eb..0153e2f4d6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -964,6 +964,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -975,6 +985,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index 49b9046f77..af7e95a889 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -644,6 +644,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -655,6 +665,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index b864dd4769..b06371461d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -1348,6 +1348,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -1359,6 +1369,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index fbf4d2e49a..bce186b03a 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -1396,6 +1396,16 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -1407,6 +1417,16 @@ public string ToString(string format) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); diff --git a/UnitsNet/QuantityFormatter.cs b/UnitsNet/QuantityFormatter.cs index 56dcb88023..76a5e468f8 100644 --- a/UnitsNet/QuantityFormatter.cs +++ b/UnitsNet/QuantityFormatter.cs @@ -36,6 +36,16 @@ public class QuantityFormatter /// The quantity to format. /// The format string. /// The format provider to use for localization and number formatting. Defaults to if null. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// /// The string representation. public static string Format(IQuantity quantity, string format, IFormatProvider formatProvider) where TUnitType : Enum diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index b25da31bd6..a9b436dec4 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -175,6 +175,16 @@ if ($obsoleteAttribute) /// /// The format string. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); @@ -186,6 +196,16 @@ if ($obsoleteAttribute) /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. + /// + /// The valid format strings are as follows: + /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m + /// "a": The default abbreviation for the quantity's unit. + /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. + /// "v": The quantity's value outputted as a string using the default representation. + /// "u": The quantity's unit + /// "q": The quantity's name. + /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format<$unitEnumName>(this, format, formatProvider); From 64b23841603d048eaf8d73e1e8fd2e001cf1091a Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Wed, 27 Feb 2019 17:21:38 -0500 Subject: [PATCH 16/21] Obsolete ToString methods. Add inheritdoc. Update tests for obsolete methods. --- UnitsNet.Tests/CustomCode/TemperatureTests.cs | 15 ++++++--- UnitsNet.Tests/QuantityIFormattableTests.cs | 12 +++---- UnitsNet.Tests/QuantityTests.ToString.cs | 6 ++-- UnitsNet.Tests/UnitAbbreviationsCacheTests.cs | 32 +++++++++---------- .../Quantities/Acceleration.NetFramework.g.cs | 32 +++++-------------- .../AmountOfSubstance.NetFramework.g.cs | 32 +++++-------------- .../AmplitudeRatio.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Angle.NetFramework.g.cs | 32 +++++-------------- .../ApparentEnergy.NetFramework.g.cs | 32 +++++-------------- .../ApparentPower.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Area.NetFramework.g.cs | 32 +++++-------------- .../Quantities/AreaDensity.NetFramework.g.cs | 32 +++++-------------- .../AreaMomentOfInertia.NetFramework.g.cs | 32 +++++-------------- .../Quantities/BitRate.NetFramework.g.cs | 32 +++++-------------- ...eSpecificFuelConsumption.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Capacitance.NetFramework.g.cs | 32 +++++-------------- ...icientOfThermalExpansion.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Density.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Duration.NetFramework.g.cs | 32 +++++-------------- .../DynamicViscosity.NetFramework.g.cs | 32 +++++-------------- .../ElectricAdmittance.NetFramework.g.cs | 32 +++++-------------- .../ElectricCharge.NetFramework.g.cs | 32 +++++-------------- .../ElectricChargeDensity.NetFramework.g.cs | 32 +++++-------------- .../ElectricConductance.NetFramework.g.cs | 32 +++++-------------- .../ElectricConductivity.NetFramework.g.cs | 32 +++++-------------- .../ElectricCurrent.NetFramework.g.cs | 32 +++++-------------- .../ElectricCurrentDensity.NetFramework.g.cs | 32 +++++-------------- .../ElectricCurrentGradient.NetFramework.g.cs | 32 +++++-------------- .../ElectricField.NetFramework.g.cs | 32 +++++-------------- .../ElectricInductance.NetFramework.g.cs | 32 +++++-------------- .../ElectricPotential.NetFramework.g.cs | 32 +++++-------------- .../ElectricPotentialAc.NetFramework.g.cs | 32 +++++-------------- .../ElectricPotentialDc.NetFramework.g.cs | 32 +++++-------------- .../ElectricResistance.NetFramework.g.cs | 32 +++++-------------- .../ElectricResistivity.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Energy.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Entropy.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Force.NetFramework.g.cs | 32 +++++-------------- .../ForceChangeRate.NetFramework.g.cs | 32 +++++-------------- .../ForcePerLength.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Frequency.NetFramework.g.cs | 32 +++++-------------- .../Quantities/HeatFlux.NetFramework.g.cs | 32 +++++-------------- .../HeatTransferCoefficient.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Illuminance.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Information.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Irradiance.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Irradiation.NetFramework.g.cs | 32 +++++-------------- .../KinematicViscosity.NetFramework.g.cs | 32 +++++-------------- .../Quantities/LapseRate.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Length.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Level.NetFramework.g.cs | 32 +++++-------------- .../LinearDensity.NetFramework.g.cs | 32 +++++-------------- .../Quantities/LuminousFlux.NetFramework.g.cs | 32 +++++-------------- .../LuminousIntensity.NetFramework.g.cs | 32 +++++-------------- .../MagneticField.NetFramework.g.cs | 32 +++++-------------- .../Quantities/MagneticFlux.NetFramework.g.cs | 32 +++++-------------- .../Magnetization.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Mass.NetFramework.g.cs | 32 +++++-------------- .../Quantities/MassFlow.NetFramework.g.cs | 32 +++++-------------- .../Quantities/MassFlux.NetFramework.g.cs | 32 +++++-------------- .../MassMomentOfInertia.NetFramework.g.cs | 32 +++++-------------- .../Quantities/MolarEnergy.NetFramework.g.cs | 32 +++++-------------- .../Quantities/MolarEntropy.NetFramework.g.cs | 32 +++++-------------- .../Quantities/MolarMass.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Molarity.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Permeability.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Permittivity.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Power.NetFramework.g.cs | 32 +++++-------------- .../Quantities/PowerDensity.NetFramework.g.cs | 32 +++++-------------- .../Quantities/PowerRatio.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Pressure.NetFramework.g.cs | 32 +++++-------------- .../PressureChangeRate.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Ratio.NetFramework.g.cs | 32 +++++-------------- .../ReactiveEnergy.NetFramework.g.cs | 32 +++++-------------- .../ReactivePower.NetFramework.g.cs | 32 +++++-------------- .../RotationalAcceleration.NetFramework.g.cs | 32 +++++-------------- .../RotationalSpeed.NetFramework.g.cs | 32 +++++-------------- .../RotationalStiffness.NetFramework.g.cs | 32 +++++-------------- ...tionalStiffnessPerLength.NetFramework.g.cs | 32 +++++-------------- .../Quantities/SolidAngle.NetFramework.g.cs | 32 +++++-------------- .../SpecificEnergy.NetFramework.g.cs | 32 +++++-------------- .../SpecificEntropy.NetFramework.g.cs | 32 +++++-------------- .../SpecificVolume.NetFramework.g.cs | 32 +++++-------------- .../SpecificWeight.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Speed.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Temperature.NetFramework.g.cs | 32 +++++-------------- .../TemperatureChangeRate.NetFramework.g.cs | 32 +++++-------------- .../TemperatureDelta.NetFramework.g.cs | 32 +++++-------------- .../ThermalConductivity.NetFramework.g.cs | 32 +++++-------------- .../ThermalResistance.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Torque.NetFramework.g.cs | 32 +++++-------------- .../Quantities/VitaminA.NetFramework.g.cs | 32 +++++-------------- .../Quantities/Volume.NetFramework.g.cs | 32 +++++-------------- .../Quantities/VolumeFlow.NetFramework.g.cs | 32 +++++-------------- .../Include-GenerateQuantitySourceCode.ps1 | 32 +++++-------------- 95 files changed, 763 insertions(+), 2214 deletions(-) diff --git a/UnitsNet.Tests/CustomCode/TemperatureTests.cs b/UnitsNet.Tests/CustomCode/TemperatureTests.cs index 29990965fe..5d67f0351f 100644 --- a/UnitsNet.Tests/CustomCode/TemperatureTests.cs +++ b/UnitsNet.Tests/CustomCode/TemperatureTests.cs @@ -43,7 +43,8 @@ public void DividedByTemperatureDeltaEqualsTemperature(TemperatureUnit unit, int // Act Temperature resultTemp = temperature.Divide(divisor, unit); - string actual = resultTemp.ToUnit(unit).ToString(CultureInfo.InvariantCulture, "{0:0} {1}"); + var resultTempInUnit = resultTemp.ToUnit(unit); + var actual = string.Format(CultureInfo.InvariantCulture, "{0:0} {1:a}", resultTempInUnit.Value, resultTempInUnit); Assert.Equal(expected, actual); } @@ -63,7 +64,8 @@ public void MultiplyByTemperatureDeltaEqualsTemperature(TemperatureUnit unit, in // Act Temperature resultTemp = temperature.Multiply(factor, unit); - string actual = resultTemp.ToUnit(unit).ToString(CultureInfo.InvariantCulture, "{0:0} {1}"); + var resultTempInUnit = resultTemp.ToUnit(unit); + var actual = string.Format(CultureInfo.InvariantCulture, "{0:0} {1:a}", resultTempInUnit.Value, resultTempInUnit); Assert.Equal(expected, actual); } @@ -82,7 +84,8 @@ public void TemperatureDeltaPlusTemperatureEqualsTemperature(TemperatureUnit uni // Act Temperature resultTemp = delta + temperature; - string actual = resultTemp.ToUnit(unit).ToString(CultureInfo.InvariantCulture, "{0:0} {1}"); + var resultTempInUnit = resultTemp.ToUnit(unit); + var actual = string.Format(CultureInfo.InvariantCulture, "{0:0} {1:a}", resultTempInUnit.Value, resultTempInUnit); Assert.Equal(expected, actual); } @@ -101,7 +104,8 @@ public void TemperatureMinusTemperatureDeltaEqualsTemperature(TemperatureUnit un // Act Temperature resultTemp = temperature - delta; - string actual = resultTemp.ToUnit(unit).ToString(CultureInfo.InvariantCulture, "{0:0} {1}"); + var resultTempInUnit = resultTemp.ToUnit(unit); + var actual = string.Format(CultureInfo.InvariantCulture, "{0:0} {1:a}", resultTempInUnit.Value, resultTempInUnit); Assert.Equal(expected, actual); } @@ -120,7 +124,8 @@ public void TemperaturePlusTemperatureDeltaEqualsTemperature(TemperatureUnit uni // Act Temperature resultTemp = temperature + delta; - string actual = resultTemp.ToUnit(unit).ToString(CultureInfo.InvariantCulture, "{0:0} {1}"); + var resultTempInUnit = resultTemp.ToUnit(unit); + var actual = string.Format(CultureInfo.InvariantCulture, "{0:0} {1:a}", resultTempInUnit.Value, resultTempInUnit); Assert.Equal(expected, actual); } } diff --git a/UnitsNet.Tests/QuantityIFormattableTests.cs b/UnitsNet.Tests/QuantityIFormattableTests.cs index 9836eb8f54..6a0219d38e 100644 --- a/UnitsNet.Tests/QuantityIFormattableTests.cs +++ b/UnitsNet.Tests/QuantityIFormattableTests.cs @@ -46,12 +46,12 @@ public void QFormatEqualsQuantityName() [Fact] public void SFormatEqualsSignificantDigits() { - Assert.Equal(length.ToString(null, 0), length.ToString("s")); - Assert.Equal(length.ToString(null, 1), length.ToString("s1")); - Assert.Equal(length.ToString(null, 2), length.ToString("s2")); - Assert.Equal(length.ToString(null, 3), length.ToString("s3")); - Assert.Equal(length.ToString(null, 4), length.ToString("s4")); - Assert.Equal(length.ToString(null, 5), length.ToString("s5")); + Assert.Equal("1 ft", length.ToString("s")); + Assert.Equal("1.2 ft", length.ToString("s1")); + Assert.Equal("1.23 ft", length.ToString("s2")); + Assert.Equal("1.235 ft", length.ToString("s3")); + Assert.Equal("1.2346 ft", length.ToString("s4")); + Assert.Equal("1.23457 ft", length.ToString("s5")); } [Fact] diff --git a/UnitsNet.Tests/QuantityTests.ToString.cs b/UnitsNet.Tests/QuantityTests.ToString.cs index 639136a84c..a38986a4b2 100644 --- a/UnitsNet.Tests/QuantityTests.ToString.cs +++ b/UnitsNet.Tests/QuantityTests.ToString.cs @@ -124,9 +124,9 @@ public void FormatsNumberUsingGivenDigitsAfterRadix() try { GlobalConfiguration.DefaultCulture = CultureInfo.InvariantCulture; - Assert.Equal("0.05 m", Length.FromCentimeters(5).ToUnit(LengthUnit.Meter).ToString(null, 4)); - Assert.Equal("1.97 in", Length.FromCentimeters(5).ToUnit(LengthUnit.Inch).ToString(null, 2)); - Assert.Equal("1.9685 in", Length.FromCentimeters(5).ToUnit(LengthUnit.Inch).ToString(null, 4)); + Assert.Equal("0.05 m", Length.FromCentimeters(5).ToUnit(LengthUnit.Meter).ToString("s4")); + Assert.Equal("1.97 in", Length.FromCentimeters(5).ToUnit(LengthUnit.Inch).ToString("s2")); + Assert.Equal("1.9685 in", Length.FromCentimeters(5).ToUnit(LengthUnit.Inch).ToString("s4")); } finally { diff --git a/UnitsNet.Tests/UnitAbbreviationsCacheTests.cs b/UnitsNet.Tests/UnitAbbreviationsCacheTests.cs index bc88f2dda9..b58afde4ea 100644 --- a/UnitsNet.Tests/UnitAbbreviationsCacheTests.cs +++ b/UnitsNet.Tests/UnitAbbreviationsCacheTests.cs @@ -117,30 +117,30 @@ public void DecimalPointDigitGroupingCultureFormatting(string culture) } [Theory] - [InlineData(1, "1.1 m")] - [InlineData(2, "1.12 m")] - [InlineData(3, "1.123 m")] - [InlineData(4, "1.1235 m")] - [InlineData(5, "1.12346 m")] - [InlineData(6, "1.123457 m")] - public void CustomNumberOfSignificantDigitsAfterRadixFormatting(int significantDigitsAfterRadix, string expected) + [InlineData("s1", "1.1 m")] + [InlineData("s2", "1.12 m")] + [InlineData("s3", "1.123 m")] + [InlineData("s4", "1.1235 m")] + [InlineData("s5", "1.12346 m")] + [InlineData("s6", "1.123457 m")] + public void CustomNumberOfSignificantDigitsAfterRadixFormatting(string significantDigitsAfterRadixFormatString, string expected) { - string actual = Length.FromMeters(1.123456789).ToUnit(LengthUnit.Meter).ToString(AmericanCulture, significantDigitsAfterRadix); + string actual = Length.FromMeters(1.123456789).ToUnit(LengthUnit.Meter).ToString(significantDigitsAfterRadixFormatString, AmericanCulture); Assert.Equal(expected, actual); } // Due to rounding, the values will result in the same string representation regardless of the number of significant digits (up to a certain point) [Theory] - [InlineData(0.819999999999, 2, "0.82 m")] - [InlineData(0.819999999999, 4, "0.82 m")] - [InlineData(0.00299999999, 2, "0.003 m")] - [InlineData(0.00299999999, 4, "0.003 m")] - [InlineData(0.0003000001, 2, "3e-04 m")] - [InlineData(0.0003000001, 4, "3e-04 m")] + [InlineData(0.819999999999, "s2", "0.82 m")] + [InlineData(0.819999999999, "s4", "0.82 m")] + [InlineData(0.00299999999, "s2", "0.003 m")] + [InlineData(0.00299999999, "s4", "0.003 m")] + [InlineData(0.0003000001, "s2", "3e-04 m")] + [InlineData(0.0003000001, "s4", "3e-04 m")] public void RoundingErrorsWithSignificantDigitsAfterRadixFormatting(double value, - int maxSignificantDigitsAfterRadix, string expected) + string significantDigitsAfterRadixFormatString, string expected) { - string actual = Length.FromMeters(value).ToUnit(LengthUnit.Meter).ToString(AmericanCulture, maxSignificantDigitsAfterRadix); + string actual = Length.FromMeters(value).ToUnit(LengthUnit.Meter).ToString(significantDigitsAfterRadixFormatString, AmericanCulture); Assert.Equal(expected, actual); } diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs index e8b7011df4..bec167cb38 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.NetFramework.g.cs @@ -781,7 +781,7 @@ private double AsBaseNumericType(AccelerationUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -790,13 +790,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -805,6 +805,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -819,6 +820,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -831,42 +833,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -938,7 +922,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs index f0f26da562..57df7f8b03 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.NetFramework.g.cs @@ -813,7 +813,7 @@ private double AsBaseNumericType(AmountOfSubstanceUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -822,13 +822,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -837,6 +837,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -851,6 +852,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -863,42 +865,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -970,7 +954,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs index b89867afda..723bdc9e93 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.NetFramework.g.cs @@ -645,7 +645,7 @@ private double AsBaseNumericType(AmplitudeRatioUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -654,13 +654,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -669,6 +669,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -683,6 +684,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -695,42 +697,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -802,7 +786,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs index c06863d899..21956ca559 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.NetFramework.g.cs @@ -797,7 +797,7 @@ private double AsBaseNumericType(AngleUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -806,13 +806,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -821,6 +821,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -835,6 +836,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -847,42 +849,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -954,7 +938,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs index 2547af38ac..c4b077849a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(ApparentEnergyUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -630,13 +630,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -645,6 +645,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -659,6 +660,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -671,42 +673,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -778,7 +762,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs index 1bd2faf400..ebd197d99a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.NetFramework.g.cs @@ -637,7 +637,7 @@ private double AsBaseNumericType(ApparentPowerUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -646,13 +646,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -661,6 +661,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -675,6 +676,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -687,42 +689,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -794,7 +778,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs index a5fd944bfd..93f6036414 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.NetFramework.g.cs @@ -781,7 +781,7 @@ private double AsBaseNumericType(AreaUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -790,13 +790,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -805,6 +805,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -819,6 +820,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -831,42 +833,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -938,7 +922,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs index 438298f9d1..f517d016f1 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.NetFramework.g.cs @@ -589,7 +589,7 @@ private double AsBaseNumericType(AreaDensityUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -598,13 +598,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -613,6 +613,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -627,6 +628,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -639,42 +641,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -746,7 +730,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs index e71caeced8..6f533b4334 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.NetFramework.g.cs @@ -669,7 +669,7 @@ private double AsBaseNumericType(AreaMomentOfInertiaUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -678,13 +678,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -693,6 +693,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -707,6 +708,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -719,42 +721,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -826,7 +810,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs index ce5c1abf7e..56d8e99380 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.NetFramework.g.cs @@ -994,7 +994,7 @@ private decimal AsBaseNumericType(BitRateUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -1003,13 +1003,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -1018,6 +1018,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1032,6 +1033,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -1044,42 +1046,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -1151,7 +1135,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs index efa2370368..46c057c63a 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(BrakeSpecificFuelConsumptionUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -630,13 +630,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -645,6 +645,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -659,6 +660,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -671,42 +673,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -778,7 +762,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs index e0f5a79cdd..bad5ac94f9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.NetFramework.g.cs @@ -688,7 +688,7 @@ private double AsBaseNumericType(CapacitanceUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -697,13 +697,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -712,6 +712,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -726,6 +727,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -738,42 +740,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -845,7 +829,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs index 49c8367962..a4159fa0ac 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(CoefficientOfThermalExpansionUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -630,13 +630,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -645,6 +645,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -659,6 +660,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -671,42 +673,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -778,7 +762,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs index fb4d395f1d..1500da2471 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.NetFramework.g.cs @@ -1200,7 +1200,7 @@ private double AsBaseNumericType(DensityUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -1209,13 +1209,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -1224,6 +1224,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1238,6 +1239,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -1250,42 +1252,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -1357,7 +1341,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs index 41e11f1f15..836d8d1e0f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.NetFramework.g.cs @@ -733,7 +733,7 @@ private double AsBaseNumericType(DurationUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -742,13 +742,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -757,6 +757,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -771,6 +772,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -783,42 +785,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -890,7 +874,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs index c6d3c33fe3..6b29888555 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.NetFramework.g.cs @@ -672,7 +672,7 @@ private double AsBaseNumericType(DynamicViscosityUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -681,13 +681,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -696,6 +696,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -710,6 +711,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -722,42 +724,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -829,7 +813,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs index 0b4b9e1a07..c71003b0d8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.NetFramework.g.cs @@ -637,7 +637,7 @@ private double AsBaseNumericType(ElectricAdmittanceUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -646,13 +646,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -661,6 +661,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -675,6 +676,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -687,42 +689,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -794,7 +778,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs index e92b2421c7..5d4ba97ee0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(ElectricChargeUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -601,13 +601,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -616,6 +616,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -630,6 +631,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -642,42 +644,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -749,7 +733,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs index 47625a9bd5..66ce107209 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(ElectricChargeDensityUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -601,13 +601,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -616,6 +616,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -630,6 +631,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -642,42 +644,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -749,7 +733,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs index 71b0e1f611..2827585bfc 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.NetFramework.g.cs @@ -624,7 +624,7 @@ private double AsBaseNumericType(ElectricConductanceUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -633,13 +633,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -648,6 +648,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -662,6 +663,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -674,42 +676,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -781,7 +765,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs index 564608c7a0..146919d028 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(ElectricConductivityUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -601,13 +601,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -616,6 +616,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -630,6 +631,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -642,42 +644,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -749,7 +733,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs index 0e043c1b2a..02fca387fc 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.NetFramework.g.cs @@ -701,7 +701,7 @@ private double AsBaseNumericType(ElectricCurrentUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -710,13 +710,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -725,6 +725,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -739,6 +740,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -751,42 +753,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -858,7 +842,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs index 123c1c4737..84b01f9410 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(ElectricCurrentDensityUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -601,13 +601,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -616,6 +616,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -630,6 +631,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -642,42 +644,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -749,7 +733,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs index 0c11cc631f..0d31767987 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.NetFramework.g.cs @@ -589,7 +589,7 @@ private double AsBaseNumericType(ElectricCurrentGradientUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -598,13 +598,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -613,6 +613,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -627,6 +628,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -639,42 +641,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -746,7 +730,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs index 361f94ed90..95bcf4896b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(ElectricFieldUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -601,13 +601,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -616,6 +616,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -630,6 +631,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -642,42 +644,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -749,7 +733,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs index d442e146a3..72bee112ac 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.NetFramework.g.cs @@ -640,7 +640,7 @@ private double AsBaseNumericType(ElectricInductanceUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -649,13 +649,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -664,6 +664,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -678,6 +679,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -690,42 +692,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -797,7 +781,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs index 21dcc9bfe2..56075a5226 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.NetFramework.g.cs @@ -653,7 +653,7 @@ private double AsBaseNumericType(ElectricPotentialUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -662,13 +662,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -677,6 +677,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -691,6 +692,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -703,42 +705,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -810,7 +794,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs index c8a88c1d2a..8248eac1ce 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.NetFramework.g.cs @@ -653,7 +653,7 @@ private double AsBaseNumericType(ElectricPotentialAcUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -662,13 +662,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -677,6 +677,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -691,6 +692,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -703,42 +705,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -810,7 +794,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs index e7af49db46..9b0697cea1 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.NetFramework.g.cs @@ -653,7 +653,7 @@ private double AsBaseNumericType(ElectricPotentialDcUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -662,13 +662,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -677,6 +677,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -691,6 +692,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -703,42 +705,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -810,7 +794,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs index 601f0bfa36..4d37505230 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.NetFramework.g.cs @@ -653,7 +653,7 @@ private double AsBaseNumericType(ElectricResistanceUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -662,13 +662,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -677,6 +677,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -691,6 +692,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -703,42 +705,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -810,7 +794,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs index dd845838c5..42e15cc875 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.NetFramework.g.cs @@ -800,7 +800,7 @@ private double AsBaseNumericType(ElectricResistivityUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -809,13 +809,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -824,6 +824,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -838,6 +839,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -850,42 +852,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -957,7 +941,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs index 1abcce1d80..459337d3a9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.NetFramework.g.cs @@ -941,7 +941,7 @@ private double AsBaseNumericType(EnergyUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -950,13 +950,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -965,6 +965,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -979,6 +980,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -991,42 +993,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -1098,7 +1082,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs index a010a95d3d..b10884b353 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.NetFramework.g.cs @@ -685,7 +685,7 @@ private double AsBaseNumericType(EntropyUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -694,13 +694,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -709,6 +709,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -723,6 +724,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -735,42 +737,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -842,7 +826,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs index 9940f62558..3d4dc99393 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.NetFramework.g.cs @@ -781,7 +781,7 @@ private double AsBaseNumericType(ForceUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -790,13 +790,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -805,6 +805,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -819,6 +820,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -831,42 +833,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -938,7 +922,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs index 41e542c08f..95223c7f72 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.NetFramework.g.cs @@ -749,7 +749,7 @@ private double AsBaseNumericType(ForceChangeRateUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -758,13 +758,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -773,6 +773,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -787,6 +788,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -799,42 +801,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -906,7 +890,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs index f44cfe5511..cf9fc19fa2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.NetFramework.g.cs @@ -717,7 +717,7 @@ private double AsBaseNumericType(ForcePerLengthUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -726,13 +726,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -741,6 +741,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -755,6 +756,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -767,42 +769,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -874,7 +858,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs index 1ed66d83e4..5789e08f92 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.NetFramework.g.cs @@ -717,7 +717,7 @@ private double AsBaseNumericType(FrequencyUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -726,13 +726,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -741,6 +741,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -755,6 +756,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -767,42 +769,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -874,7 +858,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs index 055fa2f798..56a97e3845 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.NetFramework.g.cs @@ -861,7 +861,7 @@ private double AsBaseNumericType(HeatFluxUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -870,13 +870,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -885,6 +885,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -899,6 +900,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -911,42 +913,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -1018,7 +1002,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs index 491b880f9a..df71ef6950 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.NetFramework.g.cs @@ -605,7 +605,7 @@ private double AsBaseNumericType(HeatTransferCoefficientUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -614,13 +614,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -629,6 +629,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -643,6 +644,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -655,42 +657,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -762,7 +746,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs index 2c54fca706..81d0ca3d4e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.NetFramework.g.cs @@ -640,7 +640,7 @@ private double AsBaseNumericType(IlluminanceUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -649,13 +649,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -664,6 +664,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -678,6 +679,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -690,42 +692,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -797,7 +781,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs index 0827d9309b..576ea2701b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.NetFramework.g.cs @@ -991,7 +991,7 @@ private decimal AsBaseNumericType(InformationUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -1000,13 +1000,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -1015,6 +1015,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1029,6 +1030,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -1041,42 +1043,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -1148,7 +1132,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs index 8e3a775efe..5ed295abff 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.NetFramework.g.cs @@ -797,7 +797,7 @@ private double AsBaseNumericType(IrradianceUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -806,13 +806,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -821,6 +821,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -835,6 +836,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -847,42 +849,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -954,7 +938,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs index a1d6301205..98d3a43e08 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.NetFramework.g.cs @@ -672,7 +672,7 @@ private double AsBaseNumericType(IrradiationUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -681,13 +681,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -696,6 +696,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -710,6 +711,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -722,42 +724,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -829,7 +813,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs index 80b872dc16..ce55aa8f81 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.NetFramework.g.cs @@ -704,7 +704,7 @@ private double AsBaseNumericType(KinematicViscosityUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -713,13 +713,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -728,6 +728,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -742,6 +743,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -754,42 +756,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -861,7 +845,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs index 155d93cfe6..5c1dab9d43 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.NetFramework.g.cs @@ -589,7 +589,7 @@ private double AsBaseNumericType(LapseRateUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -598,13 +598,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -613,6 +613,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -627,6 +628,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -639,42 +641,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -746,7 +730,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs index b840db3468..a605b40ef5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.NetFramework.g.cs @@ -925,7 +925,7 @@ private double AsBaseNumericType(LengthUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -934,13 +934,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -949,6 +949,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -963,6 +964,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -975,42 +977,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -1082,7 +1066,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs index d576425ebe..cf5a9365cc 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.NetFramework.g.cs @@ -613,7 +613,7 @@ private double AsBaseNumericType(LevelUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -622,13 +622,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -637,6 +637,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -651,6 +652,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -663,42 +665,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -770,7 +754,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs index a51fd2c6e4..feb86b2faf 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.NetFramework.g.cs @@ -624,7 +624,7 @@ private double AsBaseNumericType(LinearDensityUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -633,13 +633,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -648,6 +648,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -662,6 +663,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -674,42 +676,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -781,7 +765,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs index 4a4343f039..b2b3c470f6 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(LuminousFluxUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -601,13 +601,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -616,6 +616,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -630,6 +631,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -642,42 +644,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -749,7 +733,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs index bbf086c1bc..5e3d748fe7 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(LuminousIntensityUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -601,13 +601,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -616,6 +616,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -630,6 +631,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -642,42 +644,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -749,7 +733,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs index 5d60fdfea0..9856688a55 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.NetFramework.g.cs @@ -640,7 +640,7 @@ private double AsBaseNumericType(MagneticFieldUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -649,13 +649,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -664,6 +664,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -678,6 +679,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -690,42 +692,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -797,7 +781,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs index 12e2e597fa..13a37db8e2 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(MagneticFluxUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -601,13 +601,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -616,6 +616,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -630,6 +631,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -642,42 +644,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -749,7 +733,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs index 070d6b05d5..74348fe381 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(MagnetizationUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -601,13 +601,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -616,6 +616,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -630,6 +631,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -642,42 +644,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -749,7 +733,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs index c05232c781..962400b0dd 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs @@ -941,7 +941,7 @@ private double AsBaseNumericType(MassUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -950,13 +950,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -965,6 +965,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -979,6 +980,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -991,42 +993,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -1098,7 +1082,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs index d77d47ffe8..3189fda6e7 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.NetFramework.g.cs @@ -1069,7 +1069,7 @@ private double AsBaseNumericType(MassFlowUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -1078,13 +1078,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -1093,6 +1093,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1107,6 +1108,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -1119,42 +1121,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -1226,7 +1210,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs index dd22cbe9f8..07a94f1180 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.NetFramework.g.cs @@ -605,7 +605,7 @@ private double AsBaseNumericType(MassFluxUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -614,13 +614,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -629,6 +629,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -643,6 +644,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -655,42 +657,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -762,7 +746,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs index 9e0cc44d55..ccedce4d4a 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.NetFramework.g.cs @@ -1021,7 +1021,7 @@ private double AsBaseNumericType(MassMomentOfInertiaUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -1030,13 +1030,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -1045,6 +1045,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1059,6 +1060,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -1071,42 +1073,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -1178,7 +1162,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs index 9337339e74..6b21f970c9 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(MolarEnergyUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -630,13 +630,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -645,6 +645,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -659,6 +660,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -671,42 +673,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -778,7 +762,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs index 21f6adbb8a..1dc30577d9 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(MolarEntropyUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -630,13 +630,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -645,6 +645,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -659,6 +660,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -671,42 +673,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -778,7 +762,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs index 744976db36..f883ec1993 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.NetFramework.g.cs @@ -765,7 +765,7 @@ private double AsBaseNumericType(MolarMassUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -774,13 +774,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -789,6 +789,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -803,6 +804,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -815,42 +817,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -922,7 +906,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs index 9aa6ec55b2..e9e5f29b45 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.NetFramework.g.cs @@ -704,7 +704,7 @@ private double AsBaseNumericType(MolarityUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -713,13 +713,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -728,6 +728,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -742,6 +743,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -754,42 +756,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -861,7 +845,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs index 59d92be5ee..8f2d2415a9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(PermeabilityUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -601,13 +601,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -616,6 +616,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -630,6 +631,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -642,42 +644,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -749,7 +733,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs index c45707ad6e..da30e986ff 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(PermittivityUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -601,13 +601,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -616,6 +616,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -630,6 +631,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -642,42 +644,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -749,7 +733,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs index 280380ed7a..4265065bd7 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.NetFramework.g.cs @@ -895,7 +895,7 @@ private decimal AsBaseNumericType(PowerUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -904,13 +904,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -919,6 +919,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -933,6 +934,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -945,42 +947,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -1052,7 +1036,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs index 6c984636fe..6abea5f174 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.NetFramework.g.cs @@ -1277,7 +1277,7 @@ private double AsBaseNumericType(PowerDensityUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -1286,13 +1286,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -1301,6 +1301,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1315,6 +1316,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -1327,42 +1329,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -1434,7 +1418,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs index c042bad01e..96177ff0fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.NetFramework.g.cs @@ -613,7 +613,7 @@ private double AsBaseNumericType(PowerRatioUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -622,13 +622,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -637,6 +637,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -651,6 +652,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -663,42 +665,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -770,7 +754,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs index 5bc1500c53..d044e4a8a5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.NetFramework.g.cs @@ -1245,7 +1245,7 @@ private double AsBaseNumericType(PressureUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -1254,13 +1254,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -1269,6 +1269,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1283,6 +1284,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -1295,42 +1297,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -1402,7 +1386,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs index 4872e7c8f3..919a39f944 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.NetFramework.g.cs @@ -685,7 +685,7 @@ private double AsBaseNumericType(PressureChangeRateUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -694,13 +694,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -709,6 +709,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -723,6 +724,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -735,42 +737,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -842,7 +826,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs index c58962fb93..5b5346c3b9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.NetFramework.g.cs @@ -669,7 +669,7 @@ private double AsBaseNumericType(RatioUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -678,13 +678,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -693,6 +693,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -707,6 +708,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -719,42 +721,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -826,7 +810,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs index 7bf32b6d58..91ff374313 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(ReactiveEnergyUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -630,13 +630,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -645,6 +645,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -659,6 +660,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -671,42 +673,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -778,7 +762,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs index 69066db074..ae5d30a48c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.NetFramework.g.cs @@ -637,7 +637,7 @@ private double AsBaseNumericType(ReactivePowerUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -646,13 +646,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -661,6 +661,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -675,6 +676,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -687,42 +689,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -794,7 +778,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs index ad7f4254d0..b06cf7c19c 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(RotationalAccelerationUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -630,13 +630,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -645,6 +645,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -659,6 +660,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -671,42 +673,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -778,7 +762,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs index ebb7d7916c..8c0b43e8bf 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.NetFramework.g.cs @@ -781,7 +781,7 @@ private double AsBaseNumericType(RotationalSpeedUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -790,13 +790,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -805,6 +805,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -819,6 +820,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -831,42 +833,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -938,7 +922,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs index 0e9cab2f92..a983494ff0 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(RotationalStiffnessUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -630,13 +630,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -645,6 +645,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -659,6 +660,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -671,42 +673,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -778,7 +762,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs index 20db480e5b..97843038b8 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(RotationalStiffnessPerLengthUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -630,13 +630,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -645,6 +645,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -659,6 +660,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -671,42 +673,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -778,7 +762,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs index 7a5f970f39..2f8feb1b4c 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.NetFramework.g.cs @@ -592,7 +592,7 @@ private double AsBaseNumericType(SolidAngleUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -601,13 +601,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -616,6 +616,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -630,6 +631,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -642,42 +644,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -749,7 +733,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs index cf2d499e55..9b16fcfa14 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs @@ -720,7 +720,7 @@ private double AsBaseNumericType(SpecificEnergyUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -729,13 +729,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -744,6 +744,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -758,6 +759,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -770,42 +772,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -877,7 +861,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs index de858ca1f0..b97e4a38e2 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.NetFramework.g.cs @@ -701,7 +701,7 @@ private double AsBaseNumericType(SpecificEntropyUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -710,13 +710,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -725,6 +725,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -739,6 +740,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -751,42 +753,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -858,7 +842,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs index c628c8de1a..4de39f8544 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.NetFramework.g.cs @@ -621,7 +621,7 @@ private double AsBaseNumericType(SpecificVolumeUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -630,13 +630,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -645,6 +645,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -659,6 +660,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -671,42 +673,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -778,7 +762,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs index 5a4cf6d7bf..d2b3d681da 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.NetFramework.g.cs @@ -848,7 +848,7 @@ private double AsBaseNumericType(SpecificWeightUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -857,13 +857,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -872,6 +872,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -886,6 +887,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -898,42 +900,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -1005,7 +989,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs index 08f48ce0c5..3d8636e6cf 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.NetFramework.g.cs @@ -1085,7 +1085,7 @@ private double AsBaseNumericType(SpeedUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -1094,13 +1094,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -1109,6 +1109,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1123,6 +1124,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -1135,42 +1137,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -1242,7 +1226,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs index 5325ad5bc8..3df0836132 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.NetFramework.g.cs @@ -655,7 +655,7 @@ private double AsBaseNumericType(TemperatureUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -664,13 +664,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -679,6 +679,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -693,6 +694,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -705,42 +707,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -812,7 +796,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs index cc56950217..a6d1bf6ec4 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.NetFramework.g.cs @@ -733,7 +733,7 @@ private double AsBaseNumericType(TemperatureChangeRateUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -742,13 +742,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -757,6 +757,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -771,6 +772,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -783,42 +785,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -890,7 +874,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs index d941d468f2..ac07494a2d 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.NetFramework.g.cs @@ -701,7 +701,7 @@ private double AsBaseNumericType(TemperatureDeltaUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -710,13 +710,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -725,6 +725,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -739,6 +740,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -751,42 +753,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -858,7 +842,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs index ea64096bec..49ee85d5e0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.NetFramework.g.cs @@ -608,7 +608,7 @@ private double AsBaseNumericType(ThermalConductivityUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -617,13 +617,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -632,6 +632,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -646,6 +647,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -658,42 +660,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -765,7 +749,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs index 836537cac2..85db56be14 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.NetFramework.g.cs @@ -653,7 +653,7 @@ private double AsBaseNumericType(ThermalResistanceUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -662,13 +662,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -677,6 +677,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -691,6 +692,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -703,42 +705,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -810,7 +794,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs index 0153e2f4d6..bd18f91690 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.NetFramework.g.cs @@ -909,7 +909,7 @@ private double AsBaseNumericType(TorqueUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -918,13 +918,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -933,6 +933,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -947,6 +948,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -959,42 +961,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -1066,7 +1050,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs index af7e95a889..ee4ba91c00 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.NetFramework.g.cs @@ -589,7 +589,7 @@ private double AsBaseNumericType(VitaminAUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -598,13 +598,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -613,6 +613,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -627,6 +628,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -639,42 +641,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -746,7 +730,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs index b06371461d..6ef85ccaff 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.NetFramework.g.cs @@ -1293,7 +1293,7 @@ private double AsBaseNumericType(VolumeUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -1302,13 +1302,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -1317,6 +1317,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1331,6 +1332,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -1343,42 +1345,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -1450,7 +1434,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs index bce186b03a..96062d74ac 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.NetFramework.g.cs @@ -1341,7 +1341,7 @@ private double AsBaseNumericType(VolumeFlowUnit unit) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -1350,13 +1350,13 @@ public override string ToString() } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -1365,6 +1365,7 @@ public string ToString([CanBeNull] IFormatProvider provider) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -1379,6 +1380,7 @@ public string ToString([CanBeNull] IFormatProvider provider, int significantDigi /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -1391,42 +1393,24 @@ public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string fo return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format(this, format, formatProvider); @@ -1498,7 +1482,7 @@ float IConvertible.ToSingle(IFormatProvider provider) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index a9b436dec4..e9fd49038b 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -120,7 +120,7 @@ if ($obsoleteAttribute) #region ToString Methods /// - /// Get default string representation of value and unit. + /// Gets the default string representation of value and unit. /// /// String representation. public override string ToString() @@ -129,13 +129,13 @@ if ($obsoleteAttribute) } /// - /// Get string representation of value and unit. Using two significant digits after radix. + /// Gets the default string representation of value and unit using the given format provider. /// /// String representation. /// Format to use for localization and number formatting. Defaults to if null. public string ToString([CanBeNull] IFormatProvider provider) { - return ToString(provider, 2); + return ToString("g", provider); } /// @@ -144,6 +144,7 @@ if ($obsoleteAttribute) /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] public string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix) { var value = Convert.ToDouble(Value); @@ -158,6 +159,7 @@ if ($obsoleteAttribute) /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] public string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args) { if (format == null) throw new ArgumentNullException(nameof(format)); @@ -170,42 +172,24 @@ if ($obsoleteAttribute) return string.Format(provider, format, formatArgs); } + /// /// /// Gets the string representation of this instance in the specified format string using . /// /// The format string. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format) { return ToString(format, GlobalConfiguration.DefaultCulture); } + /// /// /// Gets the string representation of this instance in the specified format string using the specified format provider, or if null. /// /// The format string. /// Format to use for localization and number formatting. Defaults to if null. /// The string representation. - /// - /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m - /// public string ToString(string format, IFormatProvider formatProvider) { return QuantityFormatter.Format<$unitEnumName>(this, format, formatProvider); @@ -277,7 +261,7 @@ if ($obsoleteAttribute) string IConvertible.ToString(IFormatProvider provider) { - return ToString(provider); + return ToString("g", provider); } object IConvertible.ToType(Type conversionType, IFormatProvider provider) From 20a77b1a33a2037fa52346a93ceae42f38ccf1f0 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Thu, 28 Feb 2019 10:34:36 -0500 Subject: [PATCH 17/21] Update doc. Obsolete IQuantity ToString overloads and replace code for obsolete calls. Throw FormatException when invalid abbreviation index is requested and add test. --- UnitsNet.Tests/QuantityIFormattableTests.cs | 6 ++++ UnitsNet/IQuantity.cs | 4 ++- UnitsNet/QuantityFormatter.cs | 35 +++++++++++++++------ 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/UnitsNet.Tests/QuantityIFormattableTests.cs b/UnitsNet.Tests/QuantityIFormattableTests.cs index 6a0219d38e..0c626fddb7 100644 --- a/UnitsNet.Tests/QuantityIFormattableTests.cs +++ b/UnitsNet.Tests/QuantityIFormattableTests.cs @@ -31,6 +31,12 @@ public void AFormatGetsAbbreviations() Assert.Equal(UnitAbbreviationsCache.Default.GetUnitAbbreviations(length.Unit)[2], length.ToString("a2")); } + [Fact] + public void AFormatWithInvalidIndexThrowsFormatException() + { + Assert.Throws(() => length.ToString("a100")); + } + [Fact] public void VFormatEqualsValueToString() { diff --git a/UnitsNet/IQuantity.cs b/UnitsNet/IQuantity.cs index 9b4405f143..7710ebac11 100644 --- a/UnitsNet/IQuantity.cs +++ b/UnitsNet/IQuantity.cs @@ -10,7 +10,7 @@ namespace UnitsNet /// /// Represents a quantity. /// - public interface IQuantity + public interface IQuantity : IFormattable { /// /// The of this quantity. @@ -65,6 +65,7 @@ public interface IQuantity /// The number of significant digits after the radix point. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete(@"This method is deprecated and will be removed at a future release. Please use ToString(""s2"") or ToString(""s2"", provider) where 2 is an example of the number passed to significantDigitsAfterRadix.")] string ToString([CanBeNull] IFormatProvider provider, int significantDigitsAfterRadix); /// @@ -74,6 +75,7 @@ public interface IQuantity /// Arguments for string format. Value and unit are implictly included as arguments 0 and 1. /// String representation. /// Format to use for localization and number formatting. Defaults to if null. + [Obsolete("This method is deprecated and will be removed at a future release. Please use string.Format().")] string ToString([CanBeNull] IFormatProvider provider, [NotNull] string format, [NotNull] params object[] args); } diff --git a/UnitsNet/QuantityFormatter.cs b/UnitsNet/QuantityFormatter.cs index 76a5e468f8..862a214028 100644 --- a/UnitsNet/QuantityFormatter.cs +++ b/UnitsNet/QuantityFormatter.cs @@ -20,6 +20,7 @@ // THE SOFTWARE. using System; +using System.Linq; using UnitsNet.Units; namespace UnitsNet @@ -35,16 +36,19 @@ public class QuantityFormatter /// The quantity's unit type, for example . /// The quantity to format. /// The format string. - /// The format provider to use for localization and number formatting. Defaults to if null. + /// The format provider to use for localization and number formatting. Defaults to + /// if null. /// /// The valid format strings are as follows: - /// "g": The quantity formatted as the value with 2 significant digits after the radix, and abbreviation. For example: 1.23 m - /// "a": The default abbreviation for the quantity's unit. - /// "a0", "a1", "a2", etc.: The abbreviation with index where multiple abbreviations exist. "a0" is the same as "a" or the default abbreviation. - /// "v": The quantity's value outputted as a string using the default representation. - /// "u": The quantity's unit - /// "q": The quantity's name. - /// "s1", "s4", etc.: The quantity formatted as the value with n significant digits after the radix, and abbreviation. For example, "s4" would give: 1.2345 m + /// "g": The value with 2 significant digits after the radix followed by the unit abbreviation, such as "1.23 m". + /// "a": The default unit abbreviation for , such as "m". + /// "a0", "a1", ..., "aN": The Nth unit abbreviation for . "a0" is the same as "a". + /// A will be thrown if the requested abbreviation index does not exist. + /// "v": String representation of . + /// "u": The enum name of , such as "Meter". + /// "q": The quantity name, such as "Length". + /// "s1", "s2", ..., "sN": The value with N significant digits after the radix followed by the unit abbreviation. For example, + /// "s4" would return "1.2345 m" if is 1.2345678. Trailing zeros are omitted. /// /// The string representation. public static string Format(IQuantity quantity, string format, IFormatProvider formatProvider) @@ -69,9 +73,13 @@ public static string Format(IQuantity quantity, string for switch(formatString) { case "g": - return quantity.ToString(formatProvider, 2); + return ToStringWithSignificantDigitsAfterRadix(quantity, formatProvider, 2); case "a": var abbreviations = UnitAbbreviationsCache.Default.GetUnitAbbreviations(quantity.Unit, formatProvider); + + if(number >= abbreviations.Length) + throw new FormatException($"The {format} format string is invalid because the abbreviation index does not exist."); + return abbreviations[number]; case "v": return quantity.Value.ToString(formatProvider); @@ -80,10 +88,17 @@ public static string Format(IQuantity quantity, string for case "q": return quantity.QuantityInfo.Name; case "s": - return quantity.ToString(formatProvider, number); + return ToStringWithSignificantDigitsAfterRadix(quantity, formatProvider, number); default: throw new FormatException($"The {format} format string is not supported."); } } + + private static string ToStringWithSignificantDigitsAfterRadix(IQuantity quantity, IFormatProvider formatProvider, int number) where TUnitType : Enum + { + string formatForSignificantDigits = UnitFormatter.GetFormat(quantity.Value, number); + object[] formatArgs = UnitFormatter.GetFormatArgs(quantity.Unit, quantity.Value, formatProvider, Enumerable.Empty()); + return string.Format(formatProvider, formatForSignificantDigits, formatArgs); + } } } From 8d1e2a771017245f1b07612a5c3551e6a4c88380 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Thu, 28 Feb 2019 12:15:16 -0500 Subject: [PATCH 18/21] Converting test to use MemberData rather than rely on strings for checking values --- UnitsNet.Tests/CustomCode/TemperatureTests.cs | 151 +++++++++--------- 1 file changed, 73 insertions(+), 78 deletions(-) diff --git a/UnitsNet.Tests/CustomCode/TemperatureTests.cs b/UnitsNet.Tests/CustomCode/TemperatureTests.cs index 5d67f0351f..3fcb5d1ecd 100644 --- a/UnitsNet.Tests/CustomCode/TemperatureTests.cs +++ b/UnitsNet.Tests/CustomCode/TemperatureTests.cs @@ -1,11 +1,9 @@ // Licensed under MIT No Attribution, see LICENSE file at the root. // Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. -using System; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using System.Globalization; using Xunit; -using UnitsNet.Units; namespace UnitsNet.Tests.CustomCode { @@ -27,106 +25,103 @@ public class TemperatureTests : TemperatureTestsBase protected override double KelvinsInOneKelvin => 1; + public static IEnumerable DividedByTemperatureDeltaEqualsTemperatureData { get; } = + new List + { + new object[] { Temperature.FromDegreesCelsius(10), 1, Temperature.FromDegreesCelsius(10) }, + new object[] { Temperature.FromDegreesCelsius(10), 5, Temperature.FromDegreesCelsius(2) }, + new object[] { Temperature.FromDegreesCelsius(10), -10, Temperature.FromDegreesCelsius(-1) }, + new object[] { Temperature.FromDegreesFahrenheit(10), 1, Temperature.FromDegreesFahrenheit(10) }, + new object[] { Temperature.FromDegreesFahrenheit(10), 5, Temperature.FromDegreesFahrenheit(2) }, + new object[] { Temperature.FromDegreesFahrenheit(10), -10, Temperature.FromDegreesFahrenheit(-1) } + }; + [SuppressMessage("ReSharper", "ImpureMethodCallOnReadonlyValueField", Justification = "R# incorrectly identifies method as impure, due to internal method calls.")] [Theory] - [InlineData(TemperatureUnit.DegreeCelsius, 10, 1, "10 °C")] - [InlineData(TemperatureUnit.DegreeCelsius, 10, 5, "2 °C")] - [InlineData(TemperatureUnit.DegreeCelsius, 10, -10, "-1 °C")] - [InlineData(TemperatureUnit.DegreeFahrenheit, 10, 1, "10 °F")] - [InlineData(TemperatureUnit.DegreeFahrenheit, 10, 5, "2 °F")] - [InlineData(TemperatureUnit.DegreeFahrenheit, 10, -10, "-1 °F")] - public void DividedByTemperatureDeltaEqualsTemperature(TemperatureUnit unit, int temperatureVal, int divisor, string expected) + [MemberData(nameof(DividedByTemperatureDeltaEqualsTemperatureData))] + public void DividedByTemperatureDeltaEqualsTemperature(Temperature temperature, int divisor, Temperature expected) { - Temperature temperature = Temperature.From(temperatureVal, unit); - - // Act - Temperature resultTemp = temperature.Divide(divisor, unit); - - var resultTempInUnit = resultTemp.ToUnit(unit); - var actual = string.Format(CultureInfo.InvariantCulture, "{0:0} {1:a}", resultTempInUnit.Value, resultTempInUnit); - Assert.Equal(expected, actual); + Temperature resultTemp = temperature.Divide(divisor, temperature.Unit); + Assert.True(expected.Equals(resultTemp, 1e-5, ComparisonType.Absolute)); } + public static IEnumerable MultiplyByTemperatureDeltaEqualsTemperatureData { get; } = + new List + { + new object[] { Temperature.FromDegreesCelsius(10), 0, Temperature.FromDegreesCelsius(0) }, + new object[] { Temperature.FromDegreesCelsius(10), 5, Temperature.FromDegreesCelsius(50) }, + new object[] { Temperature.FromDegreesCelsius(10), -5, Temperature.FromDegreesCelsius(-50) }, + new object[] { Temperature.FromDegreesFahrenheit(10), 0, Temperature.FromDegreesFahrenheit(0) }, + new object[] { Temperature.FromDegreesFahrenheit(10), 5, Temperature.FromDegreesFahrenheit(50) }, + new object[] { Temperature.FromDegreesFahrenheit(10), -5, Temperature.FromDegreesFahrenheit(-50) } + }; + [SuppressMessage("ReSharper", "ImpureMethodCallOnReadonlyValueField", Justification = "R# incorrectly identifies method as impure, due to internal method calls.")] [Theory] - [InlineData(TemperatureUnit.DegreeCelsius, 10, 0, "0 °C")] - [InlineData(TemperatureUnit.DegreeCelsius, 10, 5, "50 °C")] - [InlineData(TemperatureUnit.DegreeCelsius, 10, -5, "-50 °C")] - [InlineData(TemperatureUnit.DegreeFahrenheit, 10, 0, "0 °F")] - [InlineData(TemperatureUnit.DegreeFahrenheit, 10, 5, "50 °F")] - [InlineData(TemperatureUnit.DegreeFahrenheit, 10, -5, "-50 °F")] - public void MultiplyByTemperatureDeltaEqualsTemperature(TemperatureUnit unit, int temperatureVal, int factor, string expected) + [MemberData(nameof(MultiplyByTemperatureDeltaEqualsTemperatureData))] + public void MultiplyByTemperatureDeltaEqualsTemperature(Temperature temperature, int factor, Temperature expected) { - Temperature temperature = Temperature.From(temperatureVal, unit); - - // Act - Temperature resultTemp = temperature.Multiply(factor, unit); - - var resultTempInUnit = resultTemp.ToUnit(unit); - var actual = string.Format(CultureInfo.InvariantCulture, "{0:0} {1:a}", resultTempInUnit.Value, resultTempInUnit); - Assert.Equal(expected, actual); + Temperature resultTemp = temperature.Multiply(factor, temperature.Unit); + Assert.True(expected.Equals(resultTemp, 1e-5, ComparisonType.Absolute)); } + public static IEnumerable TemperatureDeltaPlusTemperatureEqualsTemperatureData { get; } = + new List + { + new object[] { Temperature.FromDegreesCelsius(-10), TemperatureDelta.FromDegreesCelsius(0), Temperature.FromDegreesCelsius(-10) }, + new object[] { Temperature.FromDegreesCelsius(-10), TemperatureDelta.FromDegreesCelsius(10), Temperature.FromDegreesCelsius(0) }, + new object[] { Temperature.FromDegreesCelsius(-10), TemperatureDelta.FromDegreesCelsius(20), Temperature.FromDegreesCelsius(10) }, + new object[] { Temperature.FromDegreesFahrenheit(-10), TemperatureDelta.FromDegreesFahrenheit(0), Temperature.FromDegreesFahrenheit(-10) }, + new object[] { Temperature.FromDegreesFahrenheit(-10), TemperatureDelta.FromDegreesFahrenheit(10), Temperature.FromDegreesFahrenheit(0) }, + new object[] { Temperature.FromDegreesFahrenheit(-10), TemperatureDelta.FromDegreesFahrenheit(20), Temperature.FromDegreesFahrenheit(10) } + }; + [Theory] - [InlineData(TemperatureUnit.DegreeCelsius, -10, 0, "-10 °C")] - [InlineData(TemperatureUnit.DegreeCelsius, -10, 10, "0 °C")] - [InlineData(TemperatureUnit.DegreeCelsius, -10, 20, "10 °C")] - [InlineData(TemperatureUnit.DegreeFahrenheit, -10, 0, "-10 °F")] - [InlineData(TemperatureUnit.DegreeFahrenheit, -10, 10, "0 °F")] - [InlineData(TemperatureUnit.DegreeFahrenheit, -10, 20, "10 °F")] - public void TemperatureDeltaPlusTemperatureEqualsTemperature(TemperatureUnit unit, int deltaVal, int temperatureVal, string expected) + [MemberData(nameof(TemperatureDeltaPlusTemperatureEqualsTemperatureData))] + public void TemperatureDeltaPlusTemperatureEqualsTemperature(Temperature temperature, TemperatureDelta delta, Temperature expected) { - Temperature temperature = Temperature.From(temperatureVal, unit); - TemperatureDelta delta = TemperatureDelta.From(deltaVal, (TemperatureDeltaUnit)Enum.Parse(typeof(TemperatureDeltaUnit), unit.ToString())); - - // Act Temperature resultTemp = delta + temperature; - - var resultTempInUnit = resultTemp.ToUnit(unit); - var actual = string.Format(CultureInfo.InvariantCulture, "{0:0} {1:a}", resultTempInUnit.Value, resultTempInUnit); - Assert.Equal(expected, actual); + Assert.True(expected.Equals(resultTemp, 1e-5, ComparisonType.Absolute)); } + public static IEnumerable TemperatureMinusTemperatureDeltaEqualsTemperatureData { get; } = + new List + { + new object[] { Temperature.FromDegreesCelsius(20), TemperatureDelta.FromDegreesCelsius(10), Temperature.FromDegreesCelsius(10) }, + new object[] { Temperature.FromDegreesCelsius(20), TemperatureDelta.FromDegreesCelsius(20), Temperature.FromDegreesCelsius(0) }, + new object[] { Temperature.FromDegreesCelsius(20), TemperatureDelta.FromDegreesCelsius(30), Temperature.FromDegreesCelsius(-10) }, + new object[] { Temperature.FromDegreesFahrenheit(20), TemperatureDelta.FromDegreesFahrenheit(10), Temperature.FromDegreesFahrenheit(10) }, + new object[] { Temperature.FromDegreesFahrenheit(20), TemperatureDelta.FromDegreesFahrenheit(20), Temperature.FromDegreesFahrenheit(0) }, + new object[] { Temperature.FromDegreesFahrenheit(20), TemperatureDelta.FromDegreesFahrenheit(30), Temperature.FromDegreesFahrenheit(-10) } + }; + [Theory] - [InlineData(TemperatureUnit.DegreeCelsius, 20, 10, "10 °C")] - [InlineData(TemperatureUnit.DegreeCelsius, 20, 20, "0 °C")] - [InlineData(TemperatureUnit.DegreeCelsius, 20, 30, "-10 °C")] - [InlineData(TemperatureUnit.DegreeFahrenheit, 20, 10, "10 °F")] - [InlineData(TemperatureUnit.DegreeFahrenheit, 20, 20, "0 °F")] - [InlineData(TemperatureUnit.DegreeFahrenheit, 20, 30, "-10 °F")] - public void TemperatureMinusTemperatureDeltaEqualsTemperature(TemperatureUnit unit, int temperatureVal, int deltaVal, string expected) + [MemberData(nameof(TemperatureMinusTemperatureDeltaEqualsTemperatureData))] + public void TemperatureMinusTemperatureDeltaEqualsTemperature(Temperature temperature, TemperatureDelta delta, Temperature expected) { - Temperature temperature = Temperature.From(temperatureVal, unit); - TemperatureDelta delta = TemperatureDelta.From(deltaVal, (TemperatureDeltaUnit)Enum.Parse(typeof(TemperatureDeltaUnit), unit.ToString())); - - // Act Temperature resultTemp = temperature - delta; - - var resultTempInUnit = resultTemp.ToUnit(unit); - var actual = string.Format(CultureInfo.InvariantCulture, "{0:0} {1:a}", resultTempInUnit.Value, resultTempInUnit); - Assert.Equal(expected, actual); + Assert.True(expected.Equals(resultTemp, 1e-5, ComparisonType.Absolute)); } + public static IEnumerable TemperaturePlusTemperatureDeltaEqualsTemperatureData { get; } = + new List + { + new object[] { Temperature.FromDegreesCelsius(-10), TemperatureDelta.FromDegreesCelsius(0), Temperature.FromDegreesCelsius(-10) }, + new object[] { Temperature.FromDegreesCelsius(-10), TemperatureDelta.FromDegreesCelsius(10), Temperature.FromDegreesCelsius(0) }, + new object[] { Temperature.FromDegreesCelsius(-10), TemperatureDelta.FromDegreesCelsius(20), Temperature.FromDegreesCelsius(10) }, + new object[] { Temperature.FromDegreesFahrenheit(-10), TemperatureDelta.FromDegreesFahrenheit(0), Temperature.FromDegreesFahrenheit(-10) }, + new object[] { Temperature.FromDegreesFahrenheit(-10), TemperatureDelta.FromDegreesFahrenheit(10), Temperature.FromDegreesFahrenheit(0) }, + new object[] { Temperature.FromDegreesFahrenheit(-10), TemperatureDelta.FromDegreesFahrenheit(20), Temperature.FromDegreesFahrenheit(10) } + }; + [Theory] - [InlineData(TemperatureUnit.DegreeCelsius, -10, 0, "-10 °C")] - [InlineData(TemperatureUnit.DegreeCelsius, -10, 10, "0 °C")] - [InlineData(TemperatureUnit.DegreeCelsius, -10, 20, "10 °C")] - [InlineData(TemperatureUnit.DegreeFahrenheit, -10, 0, "-10 °F")] - [InlineData(TemperatureUnit.DegreeFahrenheit, -10, 10, "0 °F")] - [InlineData(TemperatureUnit.DegreeFahrenheit, -10, 20, "10 °F")] - public void TemperaturePlusTemperatureDeltaEqualsTemperature(TemperatureUnit unit, int temperatureVal, int deltaVal, string expected) + [MemberData(nameof(TemperaturePlusTemperatureDeltaEqualsTemperatureData))] + public void TemperaturePlusTemperatureDeltaEqualsTemperature(Temperature temperature, TemperatureDelta delta, Temperature expected) { - Temperature temperature = Temperature.From(temperatureVal, unit); - TemperatureDelta delta = TemperatureDelta.From(deltaVal, (TemperatureDeltaUnit)Enum.Parse(typeof(TemperatureDeltaUnit), unit.ToString())); - - // Act Temperature resultTemp = temperature + delta; - - var resultTempInUnit = resultTemp.ToUnit(unit); - var actual = string.Format(CultureInfo.InvariantCulture, "{0:0} {1:a}", resultTempInUnit.Value, resultTempInUnit); - Assert.Equal(expected, actual); + Assert.True(expected.Equals(resultTemp, 1e-5, ComparisonType.Absolute)); } } } From d2cce085fbec42a071ffe45325eac74c3f8a744f Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Thu, 28 Feb 2019 12:23:54 -0500 Subject: [PATCH 19/21] Removing duplicate test and making s format string test data-driven --- UnitsNet.Tests/QuantityIFormattableTests.cs | 18 ++++++++++-------- UnitsNet.Tests/UnitAbbreviationsCacheTests.cs | 13 ------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/UnitsNet.Tests/QuantityIFormattableTests.cs b/UnitsNet.Tests/QuantityIFormattableTests.cs index 0c626fddb7..df70e53d3a 100644 --- a/UnitsNet.Tests/QuantityIFormattableTests.cs +++ b/UnitsNet.Tests/QuantityIFormattableTests.cs @@ -49,15 +49,17 @@ public void QFormatEqualsQuantityName() Assert.Equal(Length.Info.Name, length.ToString("q")); } - [Fact] - public void SFormatEqualsSignificantDigits() + [Theory] + [InlineData("s", "1 ft")] + [InlineData("s1", "1.2 ft")] + [InlineData("s2", "1.23 ft")] + [InlineData("s3", "1.235 ft")] + [InlineData("s4", "1.2346 ft")] + [InlineData("s5", "1.23457 ft")] + [InlineData("s6", "1.234568 ft")] + public void SFormatEqualsSignificantDigits(string sFormatString, string expected) { - Assert.Equal("1 ft", length.ToString("s")); - Assert.Equal("1.2 ft", length.ToString("s1")); - Assert.Equal("1.23 ft", length.ToString("s2")); - Assert.Equal("1.235 ft", length.ToString("s3")); - Assert.Equal("1.2346 ft", length.ToString("s4")); - Assert.Equal("1.23457 ft", length.ToString("s5")); + Assert.Equal(expected, length.ToString(sFormatString)); } [Fact] diff --git a/UnitsNet.Tests/UnitAbbreviationsCacheTests.cs b/UnitsNet.Tests/UnitAbbreviationsCacheTests.cs index b58afde4ea..5103231a36 100644 --- a/UnitsNet.Tests/UnitAbbreviationsCacheTests.cs +++ b/UnitsNet.Tests/UnitAbbreviationsCacheTests.cs @@ -116,19 +116,6 @@ public void DecimalPointDigitGroupingCultureFormatting(string culture) Assert.Equal("1.111 m", Length.FromMeters(1111).ToUnit(LengthUnit.Meter).ToString(GetCulture(culture))); } - [Theory] - [InlineData("s1", "1.1 m")] - [InlineData("s2", "1.12 m")] - [InlineData("s3", "1.123 m")] - [InlineData("s4", "1.1235 m")] - [InlineData("s5", "1.12346 m")] - [InlineData("s6", "1.123457 m")] - public void CustomNumberOfSignificantDigitsAfterRadixFormatting(string significantDigitsAfterRadixFormatString, string expected) - { - string actual = Length.FromMeters(1.123456789).ToUnit(LengthUnit.Meter).ToString(significantDigitsAfterRadixFormatString, AmericanCulture); - Assert.Equal(expected, actual); - } - // Due to rounding, the values will result in the same string representation regardless of the number of significant digits (up to a certain point) [Theory] [InlineData(0.819999999999, "s2", "0.82 m")] From 007c2c968088b43c48efc2244cc3c007c9c6b8df Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Thu, 28 Feb 2019 22:06:47 -0500 Subject: [PATCH 20/21] Update comments --- .../Quantities/AmountOfSubstance.extra.cs | 22 ++----------------- UnitsNet/QuantityFormatter.cs | 22 ++----------------- 2 files changed, 4 insertions(+), 40 deletions(-) diff --git a/UnitsNet/CustomCode/Quantities/AmountOfSubstance.extra.cs b/UnitsNet/CustomCode/Quantities/AmountOfSubstance.extra.cs index a4e1de64f8..13e581bb6e 100644 --- a/UnitsNet/CustomCode/Quantities/AmountOfSubstance.extra.cs +++ b/UnitsNet/CustomCode/Quantities/AmountOfSubstance.extra.cs @@ -1,23 +1,5 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Licensed under MIT No Attribution, see LICENSE file at the root. +// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. // ReSharper disable once CheckNamespace diff --git a/UnitsNet/QuantityFormatter.cs b/UnitsNet/QuantityFormatter.cs index 04259c27cf..782c2de23c 100644 --- a/UnitsNet/QuantityFormatter.cs +++ b/UnitsNet/QuantityFormatter.cs @@ -1,23 +1,5 @@ -// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). -// https://github.com/angularsen/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Licensed under MIT No Attribution, see LICENSE file at the root. +// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. using System; using System.Globalization; From e86ea52b6f21a50c51a858afb384be010fb608a0 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Thu, 28 Feb 2019 22:08:50 -0500 Subject: [PATCH 21/21] Update comments --- UnitsNet.Tests/QuantityIFormattableTests.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/UnitsNet.Tests/QuantityIFormattableTests.cs b/UnitsNet.Tests/QuantityIFormattableTests.cs index df70e53d3a..387d05cf26 100644 --- a/UnitsNet.Tests/QuantityIFormattableTests.cs +++ b/UnitsNet.Tests/QuantityIFormattableTests.cs @@ -1,5 +1,7 @@ -using System; -using UnitsNet.Units; +// Licensed under MIT No Attribution, see LICENSE file at the root. +// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. + +using System; using Xunit; namespace UnitsNet.Tests