New source found from dndbeyond.com
This commit is contained in:
@@ -109,12 +109,15 @@ export function stripTooltipTags(str, fallback = '') {
|
||||
* Formats the specified number as a distance with the appropriate unit
|
||||
* @param distance The distance measured in feet to format
|
||||
*/
|
||||
export function renderDistance(distance) {
|
||||
export function renderDistance(distance, useMph) {
|
||||
let displayNumber = distance;
|
||||
let label = 'ft.';
|
||||
if (distance !== 0 && distance % FEET_IN_MILES === 0) {
|
||||
displayNumber = CoreUtils.convertFeetToMiles(distance);
|
||||
label = `mile${Math.abs(displayNumber) === 1 ? '' : 's'}`;
|
||||
if (useMph) {
|
||||
label = `mph`;
|
||||
}
|
||||
}
|
||||
return `${displayNumber} ${label}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user