@hrnec06/react_utils 1.2.3 → 1.2.4
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/package.json
CHANGED
|
@@ -19,7 +19,20 @@ export default function ParseValueSimple({
|
|
|
19
19
|
const numStr = value.toString();
|
|
20
20
|
|
|
21
21
|
if (numStr.length > MAX_LENGTH)
|
|
22
|
-
|
|
22
|
+
{
|
|
23
|
+
const parts = numStr.split('.');
|
|
24
|
+
|
|
25
|
+
if (parts[0].length > MAX_LENGTH || parts.length < 2)
|
|
26
|
+
return <ValueKeyword value={typeof value} />;
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
let decimals, short = parts[0];
|
|
30
|
+
|
|
31
|
+
if ((decimals = parts[1].substring(0, MAX_LENGTH - short.length - 1)) && decimals.length > 0)
|
|
32
|
+
short += '.' + decimals;
|
|
33
|
+
|
|
34
|
+
return <ValueKeyword value={short} />;
|
|
35
|
+
}
|
|
23
36
|
|
|
24
37
|
return <ValueNumber value={value} />
|
|
25
38
|
}
|
package/src/hooks/useSignal.ts
CHANGED