Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit c163531

Browse files
committed
fix: do not cast value when %
1 parent 6c56d3c commit c163531

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/components/primitives/Value.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default function Value({
3737
fallback,
3838
...props
3939
}: ValueProps) {
40-
const formatDecimals = (_format.match(/#/g) || []).length;
40+
const formatDecimals = (_format.match(/#/g) || []).length + (_format.includes("%") ? 2 : 0);
4141
const formatIsCurrency = _format.includes("$");
4242
const formatOrShow = (v: typeof children) => {
4343
if (Number(v) < 1 / 10 ** formatDecimals && !(Number(v) <= 0) && formatDecimals > 0)

0 commit comments

Comments
 (0)