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

Method FromDisplay

src/strings.cpp:832–837  ·  view source on GitHub ↗

* Convert the displayed value back into a value of OpenTTD's internal unit. * @param input The input to convert. * @param round Whether to round the value up or not. * @param divider Divide the return value by this. * @return The converted value. */

Source from the content-addressed store, hash-verified

830 * @return The converted value.
831 */
832 int64_t FromDisplay(int64_t input, bool round = true, int64_t divider = 1) const
833 {
834 return round
835 ? (int64_t)std::round(input / this->factor / divider)
836 : (int64_t)(input / this->factor / divider);
837 }
838};
839
840/** Information about a specific unit system. */

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected