Skip to content

Commit 497681d

Browse files
author
Sven Ulrich
committed
added parsefloat
1 parent f9234da commit 497681d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

dist/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,9 @@ export class String {
170170
return arg;
171171
}
172172

173-
private static decimalToHexString(number: number, upperCase: boolean = false) {
174-
const hexNumber = number.toString(16);
173+
private static decimalToHexString(value: string, upperCase: boolean = false) {
174+
const parsed = parseFloat(value as string);
175+
const hexNumber = parsed.toString(16);
175176
return upperCase ? hexNumber.toLocaleUpperCase() : hexNumber;
176177
}
177178

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"description": "Simple lightweight string operation library for Typescript, works with Angular",
55
"main": "dist/index.min.js",
66
"files": [
7-
"dist/*"
7+
"dist/**/*.js",
8+
"**/*.d.ts"
89
],
910
"scripts": {
1011
"test": "mocha -r ts-node/register tests/**/tests.ts",

0 commit comments

Comments
 (0)