@annalib/anna-core 12.1.0 → 12.1.1

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.
@@ -6129,6 +6129,18 @@ class AnnaNumberFormatService {
6129
6129
  return value.toString() + unit;
6130
6130
  // return (Math.Round(value, digitsToRoundDecimalPoint, MidpointRounding.AwayFromZero) + unit);
6131
6131
  }
6132
+ static GetRoundedImpressionsWithUnits(inputValue, digitsToRoundDecimalPoint = 0) {
6133
+ let [value, unit] = this.GetValueInUnits(Math.abs(inputValue));
6134
+ value = +value;
6135
+ if (inputValue < 0) {
6136
+ value = value * -1;
6137
+ }
6138
+ if (digitsToRoundDecimalPoint == 0 && (unit == "M" || unit == "B" || unit == "K")) {
6139
+ digitsToRoundDecimalPoint = 2;
6140
+ }
6141
+ return value.toFixed(digitsToRoundDecimalPoint) + unit;
6142
+ // return (Math.round(value, digitsToRoundDecimalPoint, MidpointRounding.AwayFromZero) + unit);
6143
+ }
6132
6144
  static GetValueInUnits(inputValue) {
6133
6145
  let unit = "";
6134
6146
  let thousand = 1000;