namirasoft-core 1.4.66 → 1.4.67

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,6 +1,6 @@
1
1
  export declare class PriceOperation {
2
- static toCent(value: number): number;
3
- static toNormal(value: number, decimal?: number): number;
4
- static fromCent(value: number): number;
5
- static fromNormal(value: number): number;
2
+ static millicent_to_cent(millicent: number): number;
3
+ static millicent_to_fiat(millicent: number, decimal?: number): number;
4
+ static cent_to_millicent(cent: number): number;
5
+ static fiat_to_millicent(fiat: number): number;
6
6
  }
@@ -2,19 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PriceOperation = void 0;
4
4
  class PriceOperation {
5
- static toCent(value) {
6
- return Math.round(value / 1000);
5
+ static millicent_to_cent(millicent) {
6
+ return Math.round(millicent / 1000);
7
7
  }
8
- static toNormal(value, decimal = 2) {
8
+ static millicent_to_fiat(millicent, decimal = 2) {
9
9
  let thousand = Math.max(5 - decimal, 0);
10
10
  let hundred = 5 - thousand;
11
- return Math.round(value / Math.pow(10, thousand)) / Math.pow(10, hundred);
11
+ return Math.round(millicent / Math.pow(10, thousand)) / Math.pow(10, hundred);
12
12
  }
13
- static fromCent(value) {
14
- return Math.floor(value * 1000);
13
+ static cent_to_millicent(cent) {
14
+ return Math.floor(cent * 1000);
15
15
  }
16
- static fromNormal(value) {
17
- return Math.floor(value * 100 * 1000);
16
+ static fiat_to_millicent(fiat) {
17
+ return Math.floor(fiat * 100 * 1000);
18
18
  }
19
19
  }
20
20
  exports.PriceOperation = PriceOperation;
@@ -1 +1 @@
1
- {"version":3,"file":"PriceOperation.js","sourceRoot":"","sources":["../src/PriceOperation.ts"],"names":[],"mappings":";;;AAAA,MAAa,cAAc;IAEvB,MAAM,CAAC,MAAM,CAAC,KAAa;QAEvB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IACpC,CAAC;IACD,MAAM,CAA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C,iBAAiB,CAAC,IAAY;QAEjC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACnC,CAAC;IACD,MAAM,CAAC,iBAAiB,CAAC,IAAY;QAEjC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC;IACzC,CAAC;CACJ;AApBD,wCAoBC"}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.4.66",
11
+ "version": "1.4.67",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/index.js",
@@ -1,21 +1,21 @@
1
1
  export class PriceOperation
2
2
  {
3
- static toCent(value: number): number
3
+ static millicent_to_cent(millicent: number): number
4
4
  {
5
- return Math.round(value / 1000);
5
+ return Math.round(millicent / 1000);
6
6
  }
7
- static toNormal(value: number, decimal: number = 2): number
7
+ static millicent_to_fiat(millicent: number, decimal: number = 2): number
8
8
  {
9
9
  let thousand = Math.max(5 - decimal, 0);
10
10
  let hundred = 5 - thousand;
11
- return Math.round(value / Math.pow(10, thousand)) / Math.pow(10, hundred);
11
+ return Math.round(millicent / Math.pow(10, thousand)) / Math.pow(10, hundred);
12
12
  }
13
- static fromCent(value: number): number
13
+ static cent_to_millicent(cent: number): number
14
14
  {
15
- return Math.floor(value * 1000);
15
+ return Math.floor(cent * 1000);
16
16
  }
17
- static fromNormal(value: number): number
17
+ static fiat_to_millicent(fiat: number): number
18
18
  {
19
- return Math.floor(value * 100 * 1000);
19
+ return Math.floor(fiat * 100 * 1000);
20
20
  }
21
21
  }