We've upgraded Humanizer from 2.8.26 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? What should I use to make it work?
This is our current code:
using System;
using Humanizer;
public class Program
{
public static void Main()
{
Console.WriteLine(1234.ToMetric(false, true, 2));
}
}
Here how to use MetricNumeralFormats for your case:
output
null
here is the format your want to useFor example,
will output
source: MetricNumeralTests and MetricNumeralFormats