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.
package/dist/PriceOperation.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare class PriceOperation {
|
|
2
|
-
static
|
|
3
|
-
static
|
|
4
|
-
static
|
|
5
|
-
static
|
|
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
|
}
|
package/dist/PriceOperation.js
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PriceOperation = void 0;
|
|
4
4
|
class PriceOperation {
|
|
5
|
-
static
|
|
6
|
-
return Math.round(
|
|
5
|
+
static millicent_to_cent(millicent) {
|
|
6
|
+
return Math.round(millicent / 1000);
|
|
7
7
|
}
|
|
8
|
-
static
|
|
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(
|
|
11
|
+
return Math.round(millicent / Math.pow(10, thousand)) / Math.pow(10, hundred);
|
|
12
12
|
}
|
|
13
|
-
static
|
|
14
|
-
return Math.floor(
|
|
13
|
+
static cent_to_millicent(cent) {
|
|
14
|
+
return Math.floor(cent * 1000);
|
|
15
15
|
}
|
|
16
|
-
static
|
|
17
|
-
return Math.floor(
|
|
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,
|
|
1
|
+
{"version":3,"file":"PriceOperation.js","sourceRoot":"","sources":["../src/PriceOperation.ts"],"names":[],"mappings":";;;AAAA,MAAa,cAAc;IAEvB,MAAM,CAAC,iBAAiB,CAAC,SAAiB;QAEtC,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IACxC,CAAC;IACD,MAAM,CAAC,iBAAiB,CAAC,SAAiB,EAAE,UAAkB,CAAC;QAE3D,IAAI,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC;QACxC,IAAI,OAAO,GAAG,CAAC,GAAG,QAAQ,CAAC;QAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAClF,CAAC;IACD,MAAM,CAAC,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
package/src/PriceOperation.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
export class PriceOperation
|
|
2
2
|
{
|
|
3
|
-
static
|
|
3
|
+
static millicent_to_cent(millicent: number): number
|
|
4
4
|
{
|
|
5
|
-
return Math.round(
|
|
5
|
+
return Math.round(millicent / 1000);
|
|
6
6
|
}
|
|
7
|
-
static
|
|
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(
|
|
11
|
+
return Math.round(millicent / Math.pow(10, thousand)) / Math.pow(10, hundred);
|
|
12
12
|
}
|
|
13
|
-
static
|
|
13
|
+
static cent_to_millicent(cent: number): number
|
|
14
14
|
{
|
|
15
|
-
return Math.floor(
|
|
15
|
+
return Math.floor(cent * 1000);
|
|
16
16
|
}
|
|
17
|
-
static
|
|
17
|
+
static fiat_to_millicent(fiat: number): number
|
|
18
18
|
{
|
|
19
|
-
return Math.floor(
|
|
19
|
+
return Math.floor(fiat * 100 * 1000);
|
|
20
20
|
}
|
|
21
21
|
}
|