X-Git-Url: https://git.yukkurigames.com/?p=string-lerp.git;a=blobdiff_plain;f=string-lerp.js;h=8e3ef6417ab7fb846538f5bc57348516fcef9753;hp=114bebd67c6ba4097f18ba25b0627a81b686a938;hb=203ddaf6c8bc3326257cfeeda9a01752fbc7ab5c;hpb=eb2b2d4d7a57095b17f17eb6cfc084cbaa37ea90 diff --git a/string-lerp.js b/string-lerp.js index 114bebd..8e3ef64 100644 --- a/string-lerp.js +++ b/string-lerp.js @@ -182,10 +182,10 @@ Numbers may have a leading "-" and a single "." to mark the decimal point, but something must be after the ".". No other floating point syntax (e.g. 1e6) is supported. - If both of the numbers in a pair are integers, the result - is clamped to an integer. + They are treated as fixed-point values, with the point's + position itself interpolating. - For example, numericLerp("0.0", "100", 0.123) === "12.3" + For example, numericLerp("0.0", "100".0, 0.123) === "12.3" because the "." in "0.0" is interpreted as a decimal point. But numericLerp("0.", "100.", 0.123) === "12." because the strings are interpreted as integers followed