@c8y/ngx-components 1024.10.2 → 1024.10.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -220,7 +220,9 @@ class YAxisService {
220
220
  formatter: val => {
221
221
  if (this.isDefined(dp.min) && this.isDefined(dp.max)) {
222
222
  const range = dp.max - dp.min;
223
- const decimalPlaces = this.getDecimalPlaces(range);
223
+ const cleanRange = parseFloat(range.toPrecision(10));
224
+ const magnitudeDecimalPlaces = cleanRange > 0 ? Math.max(0, 1 - Math.floor(Math.log10(cleanRange))) : 0;
225
+ const decimalPlaces = Math.max(this.getDecimalPlaces(cleanRange), magnitudeDecimalPlaces);
224
226
  return new Intl.NumberFormat(locale, {
225
227
  notation: 'compact',
226
228
  compactDisplay: 'short',