diff --git a/components/input/demo/tooltip.md b/components/input/demo/tooltip.md index e8befee9a3ba..34738c0340a0 100644 --- a/components/input/demo/tooltip.md +++ b/components/input/demo/tooltip.md @@ -17,19 +17,7 @@ You can use the Input in conjunction with [Tooltip](/components/tooltip) compone import { Input, Tooltip } from 'antd'; function formatNumber(value) { - value += ''; - const list = value.split('.'); - const prefix = list[0].charAt(0) === '-' ? '-' : ''; - let num = prefix ? list[0].slice(1) : list[0]; - let result = ''; - while (num.length > 3) { - result = `,${num.slice(-3)}${result}`; - num = num.slice(0, num.length - 3); - } - if (num) { - result = num + result; - } - return `${prefix}${result}${list[1] ? `.${list[1]}` : ''}`; + return new Intl.NumberFormat().format(value); } class NumericInput extends React.Component {