Skip to content

Commit be055b7

Browse files
committed
add comment about number coercion
1 parent 78d52ca commit be055b7

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/@rescript/runtime/Stdlib_Float.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ external toStringWithRadix: (float, ~radix: int) => string = "toString"
6060

6161
let fromString: string => option<float> = %raw(`str => {
6262
if (!str || !str.trim()) return;
63-
let num = +str;
63+
let num = +str; // Number coercion, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion
6464
return isNaN(num) ? undefined : num;
6565
}`)
6666

packages/@rescript/runtime/lib/es6/Stdlib_Float.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ let Constants = {};
55

66
let fromString = (str => {
77
if (!str || !str.trim()) return;
8-
let num = +str;
8+
let num = +str; // Number coercion, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion
99
return isNaN(num) ? undefined : num;
1010
});
1111

packages/@rescript/runtime/lib/js/Stdlib_Float.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ let Constants = {};
55

66
let fromString = (str => {
77
if (!str || !str.trim()) return;
8-
let num = +str;
8+
let num = +str; // Number coercion, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion
99
return isNaN(num) ? undefined : num;
1010
});
1111

0 commit comments

Comments
 (0)