MCPcopy Index your code
hub / github.com/ygs-code/vue / toNumber

Function toNumber

vue.js:128–132  ·  view source on GitHub ↗

* Convert a input value to a number for persistence. * If the conversion fails, return original string.

(val)

Source from the content-addressed store, hash-verified

126 * If the conversion fails, return original string.
127 */
128 function toNumber(val) {
129 //字符串转数字,如果失败则返回字符串
130 var n = parseFloat(val);
131 return isNaN(n) ? val : n
132 }
133
134 /**
135 * Make a map and return a function for checking if a key

Callers 3

isDirtyWithModifiersFunction · 0.85
enterFunction · 0.85
leaveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected