Anonymous user
Price fraction: Difference between revisions
→{{header|JavaScript}}
(First version) |
|||
Line 940:
Note that multiplying a string by a number produces a number, the bitwise OR (|) truncates floating point numbers to integer, making it a concise replacement for ''Math.floor''.
Passing a value outside the range 0 <= x < 1.01 will return undefined.
<lang javascript>function getScaleFactor(v) {
|