devicescript
devicescript copied to clipboard
string.toFixed
tends to land in generated code.
console.log(
`Temperature: ${temperature.toFixed(2)}°C, Humidity: ${humidity.toFixed(
2
)}%`
)
Do you mean the toFixed function of Number? I think I can handle it.
I added a function called toFixed and I wrote a test case to test it. when I run the test function, it returned message: setting field 'toFixed' of a builtin frozen object
.
Do you have a pull request we could look at?
https://github.com/microsoft/devicescript/pull/621 here is the pull request. Thank you.
@mmoskal is number prototype special handled by the compiler?
See comment on PR https://github.com/microsoft/devicescript/pull/621#issuecomment-1789310339