otomato-sdk 2.0.485 → 2.0.486

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.
@@ -1,4 +1,4 @@
1
- export const SDK_VERSION = '2.0.485';
1
+ export const SDK_VERSION = '2.0.486';
2
2
  export function compareVersions(v1, v2) {
3
3
  // Split the version strings into parts
4
4
  const v1Parts = v1.split('.').map(Number);
@@ -748,7 +748,12 @@ export function formatDisplayPrice(price) {
748
748
  if (rounded !== absPrice && getMagnitudeTier(rounded) !== getMagnitudeTier(absPrice)) {
749
749
  result = formatByMagnitude(rounded);
750
750
  }
751
- return sign + stripTrailingZeros(result);
751
+ return sign + addThousandsSeparators(stripTrailingZeros(result));
752
+ }
753
+ function addThousandsSeparators(value) {
754
+ const [intPart, decPart] = value.split('.');
755
+ const withCommas = intPart.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
756
+ return decPart !== undefined ? `${withCommas}.${decPart}` : withCommas;
752
757
  }
753
758
  function stripTrailingZeros(value) {
754
759
  if (!value.includes('.'))
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "2.0.485";
1
+ export declare const SDK_VERSION = "2.0.486";
2
2
  export declare function compareVersions(v1: string, v2: string): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "otomato-sdk",
3
- "version": "2.0.485",
3
+ "version": "2.0.486",
4
4
  "description": "An SDK for building and managing automations on Otomato",
5
5
  "repository": {
6
6
  "type": "git",