@xylabs/decimal-precision 5.0.95 → 5.0.97

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.
Files changed (2) hide show
  1. package/README.md +73 -73
  2. package/package.json +6 -9
package/README.md CHANGED
@@ -1,56 +1,76 @@
1
1
  # @xylabs/decimal-precision
2
2
 
3
- [![logo][]](https://xylabs.com)
3
+ [![npm][npm-badge]][npm-link]
4
+ [![license][license-badge]][license-link]
4
5
 
5
- [![main-build][]][main-build-link]
6
- [![npm-badge][]][npm-link]
7
- [![npm-downloads-badge][]][npm-link]
8
- [![jsdelivr-badge][]][jsdelivr-link]
9
- [![npm-license-badge][]](LICENSE)
10
- [![codacy-badge][]][codacy-link]
11
- [![codeclimate-badge][]][codeclimate-link]
12
- [![snyk-badge][]][snyk-link]
13
- [![socket-badge][]][socket-link]
6
+ > Base functionality used throughout XY Labs TypeScript/JavaScript libraries
14
7
 
8
+ ## Install
15
9
 
16
- Base functionality used throughout XY Labs TypeScript/JavaScript libraries
10
+ Using npm:
17
11
 
12
+ ```sh
13
+ npm install {{name}}
14
+ ```
18
15
 
16
+ Using yarn:
19
17
 
20
- ## Reference
18
+ ```sh
19
+ yarn add {{name}}
20
+ ```
21
21
 
22
- **@xylabs/decimal-precision**
22
+ Using pnpm:
23
23
 
24
- ***
24
+ ```sh
25
+ pnpm add {{name}}
26
+ ```
27
+
28
+ Using bun:
29
+
30
+ ```sh
31
+ bun add {{name}}
32
+ ```
33
+
34
+
35
+ ## License
36
+
37
+ See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
38
+
39
+ ## Reference
40
+
41
+ ### packages
25
42
 
26
- ## Functions
43
+ ### decimal-precision
27
44
 
28
- | Function | Description |
29
- | ------ | ------ |
30
- | [fromFixedPoint](#functions/fromFixedPoint) | Converts a fixed-point bigint back to a whole-number bigint by dividing out the decimal places. |
31
- | [toDecimalPrecision](#functions/toDecimalPrecision) | Formats a number to the specified number of significant digits, returning a string with minimal trailing zeros. |
32
- | [toFixedPoint](#functions/toFixedPoint) | Converts a bigint or decimal string to a fixed-point bigint representation. |
45
+ ### .temp-typedoc
33
46
 
34
- ### functions
47
+ ### functions
35
48
 
36
- ### <a id="fromFixedPoint"></a>fromFixedPoint
49
+ ### <a id="fromFixedPoint"></a>fromFixedPoint
37
50
 
38
51
  [**@xylabs/decimal-precision**](#../README)
39
52
 
40
53
  ***
41
54
 
42
55
  ```ts
43
- function fromFixedPoint(value: bigint, places?: number): bigint;
56
+ function fromFixedPoint(value, places?): bigint;
44
57
  ```
45
58
 
46
59
  Converts a fixed-point bigint back to a whole-number bigint by dividing out the decimal places.
47
60
 
48
61
  ## Parameters
49
62
 
50
- | Parameter | Type | Default value | Description |
51
- | ------ | ------ | ------ | ------ |
52
- | `value` | `bigint` | `undefined` | The fixed-point bigint value to convert |
53
- | `places` | `number` | `18` | Number of decimal places (default 18) |
63
+ ### value
64
+
65
+ `bigint`
66
+
67
+ The fixed-point bigint value to convert
68
+
69
+ ### places?
70
+
71
+ `number` = `18`
72
+
73
+ Number of decimal places (default 18)
54
74
 
55
75
  ## Returns
56
76
 
@@ -58,24 +78,31 @@ Converts a fixed-point bigint back to a whole-number bigint by dividing out the
58
78
 
59
79
  The whole-number bigint result
60
80
 
61
- ### <a id="toDecimalPrecision"></a>toDecimalPrecision
81
+ ### <a id="toDecimalPrecision"></a>toDecimalPrecision
62
82
 
63
83
  [**@xylabs/decimal-precision**](#../README)
64
84
 
65
85
  ***
66
86
 
67
87
  ```ts
68
- function toDecimalPrecision(value: number, digits: number): string;
88
+ function toDecimalPrecision(value, digits): string;
69
89
  ```
70
90
 
71
91
  Formats a number to the specified number of significant digits, returning a string with minimal trailing zeros.
72
92
 
73
93
  ## Parameters
74
94
 
75
- | Parameter | Type | Description |
76
- | ------ | ------ | ------ |
77
- | `value` | `number` | The number to format |
78
- | `digits` | `number` | The number of significant digits |
95
+ ### value
96
+
97
+ `number`
98
+
99
+ The number to format
100
+
101
+ ### digits
102
+
103
+ `number`
104
+
105
+ The number of significant digits
79
106
 
80
107
  ## Returns
81
108
 
@@ -83,67 +110,40 @@ Formats a number to the specified number of significant digits, returning a stri
83
110
 
84
111
  A string representation of the number with the specified precision
85
112
 
86
- ### <a id="toFixedPoint"></a>toFixedPoint
113
+ ### <a id="toFixedPoint"></a>toFixedPoint
87
114
 
88
115
  [**@xylabs/decimal-precision**](#../README)
89
116
 
90
117
  ***
91
118
 
92
119
  ```ts
93
- function toFixedPoint(value: string | bigint, places?: number): bigint;
120
+ function toFixedPoint(value, places?): bigint;
94
121
  ```
95
122
 
96
123
  Converts a bigint or decimal string to a fixed-point bigint representation.
97
124
 
98
125
  ## Parameters
99
126
 
100
- | Parameter | Type | Default value | Description |
101
- | ------ | ------ | ------ | ------ |
102
- | `value` | `string` \| `bigint` | `undefined` | The value to convert (bigint or string with optional decimal point) |
103
- | `places` | `number` | `18` | Number of decimal places (default 18) |
127
+ ### value
104
128
 
105
- ## Returns
129
+ `string` \| `bigint`
106
130
 
107
- `bigint`
108
-
109
- A bigint representing the value scaled by 10^places
131
+ The value to convert (bigint or string with optional decimal point)
110
132
 
133
+ ### places?
111
134
 
112
- Part of [sdk-js](https://www.npmjs.com/package/@xyo-network/sdk-js)
135
+ `number` = `18`
113
136
 
114
- ## Maintainers
137
+ Number of decimal places (default 18)
115
138
 
116
- - [Arie Trouw](https://github.com/arietrouw) ([arietrouw.com](https://arietrouw.com))
117
- - [Matt Jones](https://github.com/jonesmac)
118
- - [Joel Carter](https://github.com/JoelBCarter)
119
- - [Jordan Trouw](https://github.com/jordantrouw)
120
-
121
- ## License
122
-
123
- > See the [LICENSE](LICENSE) file for license details
139
+ ## Returns
124
140
 
125
- ## Credits
141
+ `bigint`
126
142
 
127
- [Made with 🔥 and ❄️ by XYLabs](https://xylabs.com)
143
+ A bigint representing the value scaled by 10^places
128
144
 
129
- [logo]: https://cdn.xy.company/img/brand/XYPersistentCompany_Logo_Icon_Colored.svg
130
145
 
131
- [main-build]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml/badge.svg
132
- [main-build-link]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml
133
146
  [npm-badge]: https://img.shields.io/npm/v/@xylabs/decimal-precision.svg
134
147
  [npm-link]: https://www.npmjs.com/package/@xylabs/decimal-precision
135
- [codacy-badge]: https://app.codacy.com/project/badge/Grade/c8e15e14f37741c18cfb47ac7245c698
136
- [codacy-link]: https://www.codacy.com/gh/xylabs/sdk-js/dashboard?utm_source=github.com&utm_medium=referral&utm_content=xylabs/sdk-js&utm_campaign=Badge_Grade
137
- [codeclimate-badge]: https://api.codeclimate.com/v1/badges/c5eb068f806f0b047ea7/maintainability
138
- [codeclimate-link]: https://codeclimate.com/github/xylabs/sdk-js/maintainability
139
- [snyk-badge]: https://snyk.io/test/github/xylabs/sdk-js/badge.svg?targetFile=package.json
140
- [snyk-link]: https://snyk.io/test/github/xylabs/sdk-js?targetFile=package.json
141
-
142
- [npm-downloads-badge]: https://img.shields.io/npm/dw/@xylabs/decimal-precision
143
- [npm-license-badge]: https://img.shields.io/npm/l/@xylabs/decimal-precision
144
-
145
- [jsdelivr-badge]: https://data.jsdelivr.com/v1/package/npm/@xylabs/decimal-precision/badge
146
- [jsdelivr-link]: https://www.jsdelivr.com/package/npm/@xylabs/decimal-precision
147
-
148
- [socket-badge]: https://socket.dev/api/badge/npm/package/@xylabs/decimal-precision
149
- [socket-link]: https://socket.dev/npm/package/@xylabs/decimal-precision
148
+ [license-badge]: https://img.shields.io/npm/l/@xylabs/decimal-precision.svg
149
+ [license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/decimal-precision",
3
- "version": "5.0.95",
3
+ "version": "5.0.97",
4
4
  "description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
5
5
  "keywords": [
6
6
  "decimal",
@@ -30,12 +30,10 @@
30
30
  "exports": {
31
31
  ".": {
32
32
  "types": "./dist/neutral/index.d.ts",
33
- "import": "./dist/neutral/index.mjs",
34
33
  "default": "./dist/neutral/index.mjs"
35
34
  },
36
35
  "./package.json": "./package.json"
37
36
  },
38
- "types": "./dist/neutral/index.d.ts",
39
37
  "files": [
40
38
  "dist",
41
39
  "!**/*.bench.*",
@@ -44,14 +42,13 @@
44
42
  "README.md"
45
43
  ],
46
44
  "devDependencies": {
47
- "@types/node": "^25.5.2",
48
- "@xylabs/ts-scripts-common": "~7.8.4",
49
- "@xylabs/ts-scripts-pnpm": "~7.8.4",
50
- "@xylabs/tsconfig": "~7.8.4",
45
+ "@types/node": "^25.6.0",
46
+ "@xylabs/toolchain": "~7.10.4",
47
+ "@xylabs/tsconfig": "~7.10.4",
51
48
  "esbuild": "^0.28.0",
52
49
  "typescript": "^5",
53
- "vite": "^8.0.5",
54
- "vitest": "^4.1.2"
50
+ "vite": "^8.0.8",
51
+ "vitest": "^4.1.4"
55
52
  },
56
53
  "engines": {
57
54
  "node": ">=18"