NumberValue changing it’s value to a lower value with random numbers

I’m making a game that uses NumberValues to hold the prices of the object, one of the object’s price value is 5 with 27 zeroes after it, but when I put it to that it changes the value to “4999999999999999791559868416” instead of the number I want.

This is because your number is overflowing, Roblox numbers have a maximum value.

The maximum number Roblox can store is 2^63-1 (9.22 x 10^18)

It used to never do this though, and instead would turn it into and “e+” value.

That isn’t overflow, that is a large number that is still comprehensible by Roblox. 5e+27 is too large for Roblox to handle.

It no longer turns anything into e+ though. It used to and would allow big numbers like that.

You aren’t understanding, this number is simply too big. Numbers that are represented by e+ are still able to be handed by Roblox. 5e+27 is just way too big.

As I said earlier, if the number is larger then 9.22e+18, it overflows.

So I can’t make numbers bigger than that without it breaking.

That is correct. It goes from 9.22e+18 to -9.22e+18 and then continues back upwards from there. It’s how binary math works.

Basically Roblox uses a 64 bit (8 byte) system for storing integer numbers.
9.22e+18 (2^64 - 1) in either direction

In a computer’s RAM numbers are stored as a string of 1s and 0s, with the largest number being a 0 followed by 63 1s. The smallest is a string of 64 1s. When you add 1 to 2^64 - 1 it becomes a string of 64 1s, therefore making it the smallest negative number and overflowing. Normally a bit would carry into the front, but since there are only 64 bits, there is no 65th bit to carry into. And it becomes negative.