feat: percentage

This commit is contained in:
TrèsAbhi committed 2024-04-05 14:05:15 -05:00
1 parent 1b88773e28
commit ecc029402e
1 file changed
+14 -8
+14 -8
View File
@@ -179,11 +179,7 @@ export default function Page() {
height: '100%',
}}
>
<Text
style={{
textAlign: 'center',
}}
>
<Text style={{ textAlign: 'center' }} wrap="nowrap">
{display
? display(stats[index])
: decimals === undefined
@@ -206,6 +202,16 @@ export default function Page() {
)
</Text>
)}
{deltaMode === 'percentage' && (
<Text color="gray">
(
{`${deltaPercentage > 0 ? '+' : ''}${Math.round(
deltaPercentage * 100,
)}%`}
)
</Text>
)}
</>
)}
</Flex>
@@ -416,17 +422,17 @@ export default function Page() {
<Row name="Speed backwards" value="speedBackwards" decimals={0} />
<Row name="Engine power" value="enginePower" decimals={0} />
<Row
name="Power to weight ratio on hard terrain"
name="Power to weight ratio hard terrain"
value="powerToWeightRatioHardTerrain"
decimals={1}
/>
<Row
name="Power to weight ratio on medium terrain"
name="Power to weight ratio medium terrain"
value="powerToWeightRatioMediumTerrain"
decimals={1}
/>
<Row
name="Power to weight ratio on soft terrain"
name="Power to weight ratio soft terrain"
value="powerToWeightRatioSoftTerrain"
decimals={1}
/>