MetricNumeralExtensions.ToMetric is obsolete, use MetricNumeralFormats?
We've upgraded 2.8.26 from to 2.11.10 and now get the following warning:
'MetricNumeralExtensions.ToMetric(double, bool, bool, int?)' is obsolete: 'Please use overload with MetricNumeralFormats'
Are there any examples on how to use MetricNumeralFormats, I cannot find any documentation.
This is our current code:
.ToMetric(false, true, 2);
@LeahPike You have to use:
var format = MetricNumeralFormats.WithSpace | MetricNumeralFormats.UseName;
var decimals = 2;
foo.ToMetric(format, decimals);
source: MetricNumeralTests and MetricNumeralFormats
As the original creator of the feature (with all the boolean), I love this choice made by the Humanizr's team. It is clearer like this :)
Thank you :)
You are welcome. I added this Q&A to stackoverflow: https://stackoverflow.com/questions/68542840/metricnumeralextensions-tometric-is-obsolete-use-metricnumeralformats/68542841#68542841