小数点模式强制小数点模式 小数点模式输入的数字默认被赋予小数点,保持数据格式统一,显示起来美观 强制小数点模式强制显示两位小数 x.xx TextField { id: textField placeholderText: qsTr("Text Field") onAccepted:( text = (text*100/100).toFixed(2), console.log(text) ) } 使用 text*100/100 强制输入值变为小数使用js函数 toFixed(2) 来控制小数点位为 2