Hi, sirjohnthetall,
following snippet works for me, and is not sooo big, I would argue:
(if: ($inpFloat - (floor: $inpFloat)) is 0.5)[\
(set: $res to (floor: $inpFloat))]
(else:)[(set: $res to (round: $inpFloat))]
Then I played a bit around with different numbers:
passage named 'Start':
{ <!-- this (until the closing brace) only to avoid lines of empty space in output -->
<!-- prompt for input -->
(set: $inpFloat to (num: (prompt: "Enter number, point delimiter", "1.5")))
<!-- calc the result, should x.5 round down to x -->
(if: ($inpFloat - (floor: $inpFloat)) is 0.5)[(set: $res to (floor: $inpFloat))]
(else:)[(set: $res to (round: $inpFloat))]
}
<!-- show result to user and provide restart link for more -->
inpFloat:>|$inpFloat|< rounded to >|$res|<
[[Again?->Start]]
There is a kind of funny effect, I think which is founded in Javascript, not in Twine2/Harlowe2.
0.500000000000000 => 0
0.500000000000001 => 1
0.5000000000000001 => 1
0.50000000000000001 => 0