You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Exponent notation of float numbers begin too early #7
Currently float numbers (after conversion to string) are displayed using exponent notation if they are greater than 10^7, which is still within the limits of a normal Minecraft world, making it difficult to read if using Meteor Client to display coordinates beyond this point. There doesn't seem to be any workarounds.
Yes I'm currently using this, having figured it out some hours ago. But it would be nicer if I'm still able to see some decimal places (i round them to 2 decimal places because sometimes I want to align myself to the center of tunnels).
Yes I'm currently using this, having figured it out some hours ago. But it would be nicer if I'm still able to see some decimal places (i round them to 2 decimal places because sometimes I want to align myself to the center of tunnels).
You can do {round(x * 100) / 100} to achieve 2 decimal places iirc
@Xenapte a bit late on this, but Pos: #1{player.pos.x >= 10000000 ? round(player.pos.x) : round(player.pos.x * 100) / 100} {round(player.pos.y * 100) / 100} {player.pos.z >= 10000000 ? round(player.pos.z) : round(player.pos.z * 100) / 100} should be what you're after
Sorry for the late reply, but still the problem persists using this (I wanted to see 2 decimal places for numbers larger than 10 million) - though I did tweak this to be more robust for different coordinates: Pos: #1{abs(player.pos.x) >= 10000000 ? floor(round(player.pos.x)) : round(player.pos.x, 2)}, {round(player.pos.y, 2)}, {abs(player.pos.z) >= 10000000 ? floor(round(player.pos.z)) : round(player.pos.z, 2)}. For now I'm going to just try to get used to integer displays for large numbers.
Sorry for the late reply, but still the problem persists using this (I wanted to see 2 decimal places for numbers larger than 10 million) - though I did tweak this to be more robust for different coordinates: Pos: #1{abs(player.pos.x) >= 10000000 ? floor(round(player.pos.x)) : round(player.pos.x, 2)}, {round(player.pos.y, 2)}, {abs(player.pos.z) >= 10000000 ? floor(round(player.pos.z)) : round(player.pos.z, 2)}. For now I'm going to just try to get used to integer displays for large numbers.
Yeah I will try to fix the big decimals in the starscript source itself
Activity
crosby-moe commentedon Mar 9, 2023
starscript/src/main/java/org/meteordev/starscript/value/Value.java
Line 136 in 20764f0
crosby-moe commentedon Mar 9, 2023
Only happens with
Double.toString(), so if the number has a fractional part, and is10000000or aboveProbably possible to bypass it by rounding to an integer if the value reaches the threshold, so something like
{z >= 10000000 ? round(z) : z}Xenapte commentedon Mar 9, 2023
Yes I'm currently using this, having figured it out some hours ago. But it would be nicer if I'm still able to see some decimal places (i round them to 2 decimal places because sometimes I want to align myself to the center of tunnels).
crosby-moe commentedon Mar 9, 2023
You can do
{round(x * 100) / 100}to achieve 2 decimal places iircXenapte commentedon Mar 9, 2023
No, that still gives exponent notation. Thanks for the help tho
crosby-moe commentedon Mar 9, 2023
Oh yeah you cant easily have both decimals and regular notation
crosby-moe commentedon Mar 13, 2023
@Xenapte a bit late on this, but
Pos: #1{player.pos.x >= 10000000 ? round(player.pos.x) : round(player.pos.x * 100) / 100} {round(player.pos.y * 100) / 100} {player.pos.z >= 10000000 ? round(player.pos.z) : round(player.pos.z * 100) / 100}should be what you're afterXenapte commentedon Mar 15, 2023
Sorry for the late reply, but still the problem persists using this (I wanted to see 2 decimal places for numbers larger than 10 million) - though I did tweak this to be more robust for different coordinates:
Pos: #1{abs(player.pos.x) >= 10000000 ? floor(round(player.pos.x)) : round(player.pos.x, 2)}, {round(player.pos.y, 2)}, {abs(player.pos.z) >= 10000000 ? floor(round(player.pos.z)) : round(player.pos.z, 2)}. For now I'm going to just try to get used to integer displays for large numbers.crosby-moe commentedon Mar 15, 2023
Yeah I will try to fix the big decimals in the starscript source itself
Xenapte commentedon Mar 16, 2023
Thanks!