Helper for unit conversion. More...
Public Member Functions | |
| int64 | ToDisplay (int64 input, bool round=true) const |
| Convert value from OpenTTD's internal unit into the displayed value. | |
| int64 | FromDisplay (int64 input, bool round=true) const |
| Convert the displayed value back into a value of OpenTTD's internal unit. | |
Data Fields | |
| int | multiplier |
| Amount to multiply upon conversion. | |
| int | shift |
| Amount to shift upon conversion. | |
Helper for unit conversion.
Definition at line 567 of file strings.cpp.
| int64 UnitConversion::FromDisplay | ( | int64 | input, | |
| bool | round = true | |||
| ) | const [inline] |
Convert the displayed value back into a value of OpenTTD's internal unit.
| input | The input to convert. | |
| round | Whether to round the value or not. |
Definition at line 588 of file strings.cpp.
References shift.
Referenced by ConvertDisplaySpeedToSpeed().
| int64 UnitConversion::ToDisplay | ( | int64 | input, | |
| bool | round = true | |||
| ) | const [inline] |
Convert value from OpenTTD's internal unit into the displayed value.
| input | The input to convert. | |
| round | Whether to round the value or not. |
Definition at line 577 of file strings.cpp.
References shift.
Referenced by ConvertSpeedToDisplaySpeed(), and FormatString().
1.7.1