MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ToDisplay

Method ToDisplay

src/strings.cpp:818–823  ·  view source on GitHub ↗

* Convert value from OpenTTD's internal unit into the displayed value. * @param input The input to convert. * @param round Whether to round the value or not. * @return The converted value. */

Source from the content-addressed store, hash-verified

816 * @return The converted value.
817 */
818 int64_t ToDisplay(int64_t input, bool round = true) const
819 {
820 return round
821 ? (int64_t)std::round(input * this->factor)
822 : (int64_t)(input * this->factor);
823 }
824
825 /**
826 * Convert the displayed value back into a value of OpenTTD's internal unit.

Callers 3

FormatStringFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected