function computeMaxDecimalsForValues(values, options) {
  try {
    // Intl.NumberFormat isn't supported on all browsers, so wrap in try/catch
    const formatter = Intl.NumberFormat("en", options);
    let maxDecimalCount = 0;
    for (const value of values) {
      const parts = formatter.formatToParts(value);
      const part = parts.find(p => p.type === "fraction");
      const decimalCount = part ? part.value.length : 0;
      if (decimalCount > maxDecimalCount) {
        maxDecimalCount = decimalCount;
      }
    }
    return maxDecimalCount;
  } catch (e) {
    return undefined;
  }
}
// values in the chart with a certain number of significant digits.
values in the chart with a certain number of significant digits.
values in the chart with a certain number of significant digits .
function computeMaxDecimalsForValues(values, options) {
  try {
    const formatter = Intl.NumberFormat("en", options);
    let maxDecimalCount = 0;
    for (const value of values) {
      const parts = formatter.formatToParts(value);
      const part = parts.find(p => p.type === "fraction");
      const decimalCount = part ? part.value.length : 0;
      if (decimalCount > maxDecimalCount) {
        maxDecimalCount = decimalCount;
      }
    }
    return maxDecimalCount;
  } catch (e) {
    return undefined;
  }
}
function computeMaxDecimalsForValues ( values , options ) { try { const formatter = Intl . NumberFormat ( "en" , options ) ; let maxDecimalCount = 0 ; for ( const value of values ) { const parts = formatter . formatToParts ( value ) ; const part = parts . find ( p => p . type === "fraction" ) ; const decimalCount = part ? part . value . length : 0 ; if ( decimalCount > maxDecimalCount ) { maxDecimalCount = decimalCount ; } } return maxDecimalCount ; } catch ( e ) { return undefined ; } }
values in the chart with a certain number of significant digits.
values in the chart with a certain number of significant digits .
// Intl.NumberFormat isn't supported on all browsers, so wrap in try/catch