Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我知道为什么要修复返回 String,考虑到这一点,是否可以将“NaN”字符串转换为 NaN 以保持以下表达式可行?
var numberWithPrecission = (1*"A").ToFixed(2) || 0;
如建议:
var numberWithPrecission = (1*"A" || 0).toFixed(2);