Remove Float assertion [#75219]

If :total_cost is incorrect, the to_percent assertion a few lines down should fail.
Work around Float issues between Ruby versions [#75219]