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%', height: '100%',
}} }}
> >
<Text <Text style={{ textAlign: 'center' }} wrap="nowrap">
style={{
textAlign: 'center',
}}
>
{display {display
? display(stats[index]) ? display(stats[index])
: decimals === undefined : decimals === undefined
@@ -206,6 +202,16 @@ export default function Page() {
) )
</Text> </Text>
)} )}
{deltaMode === 'percentage' && (
<Text color="gray">
(
{`${deltaPercentage > 0 ? '+' : ''}${Math.round(
deltaPercentage * 100,
)}%`}
)
</Text>
)}
</> </>
)} )}
</Flex> </Flex>
@@ -416,17 +422,17 @@ export default function Page() {
<Row name="Speed backwards" value="speedBackwards" decimals={0} /> <Row name="Speed backwards" value="speedBackwards" decimals={0} />
<Row name="Engine power" value="enginePower" decimals={0} /> <Row name="Engine power" value="enginePower" decimals={0} />
<Row <Row
name="Power to weight ratio on hard terrain" name="Power to weight ratio hard terrain"
value="powerToWeightRatioHardTerrain" value="powerToWeightRatioHardTerrain"
decimals={1} decimals={1}
/> />
<Row <Row
name="Power to weight ratio on medium terrain" name="Power to weight ratio medium terrain"
value="powerToWeightRatioMediumTerrain" value="powerToWeightRatioMediumTerrain"
decimals={1} decimals={1}
/> />
<Row <Row
name="Power to weight ratio on soft terrain" name="Power to weight ratio soft terrain"
value="powerToWeightRatioSoftTerrain" value="powerToWeightRatioSoftTerrain"
decimals={1} decimals={1}
/> />