fix: percent value should divide by 100 (#2781)

This commit is contained in:
katherinehhh 2023-10-10 11:14:47 +08:00 committed by GitHub
parent 08d4994305
commit 79f9e04413
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,10 +13,11 @@ export const Percent = connect(
{...props} {...props}
addonAfter="%" addonAfter="%"
defaultValue={value ? math.round(value * 100, 9) : null} defaultValue={value ? math.round(value * 100, 9) : null}
min={0} formatter={(v: any) => (v ? math.round(v * 100, 9) : null)}
onChange={(v: any) => { onChange={(v: any) => {
if (onChange) { if (onChange) {
onChange(v); const val = v ? math.round(v / 100, 9) : 0;
onChange(val);
} }
}} }}
/> />