Ozzypig / repr

Convert any Lua object into a printable string, like Python's repr
Do What The F*ck You Want To Public License
16 stars 7 forks source link

Repr improperly prints floating point types #6

Open 3dsboy08 opened 2 years ago

3dsboy08 commented 2 years ago

Try the following:

print(repr({Vector3.new(math.random(), math.random(), math.random())}))

...and you will see it print out Vector3.new(0, 0, 0).

This is because you use %d, not %g - return ("Vector3.new(%d, %d, %d)"):format(v.X, v.Y, v.Z)

I can submit a PR for this if need be - ping if you want me to do so.

t0v4 commented 1 month ago

@3dsboy08 When will hollywood become opensource