New source found from dndbeyond.com

This commit is contained in:
2025-07-09 01:00:11 -07:00
parent b7f7f4a655
commit 151590af7a
18 changed files with 150 additions and 45 deletions
@@ -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}`;
}