x


Stop Inspector from truncating doubles

Is there any way to turn off value truncation in the inspector? If I enter the value -116.431985123 and hit enter the following happens:

  • The inspector truncates it and show it as -116.432.
  • In the script, the actual value is now -116.431983947754

I don't mind not showing the digits in the inspector but I absolutely need the value to be what I set it to.

more ▼

asked Jun 11 '12 at 07:10 PM

insominx gravatar image

insominx
287 2 7 11

I don't think you can. But you can cheat.

In the inspector : 116431983947754

In the code : myVar *= 0.000000000001

=> Nope, don't work, sorry about that (it was an answer, I moved it).

Jun 11 '12 at 07:53 PM Berenger
(comments are locked)
10|3000 characters needed characters left

1 answer: sort newest

I think the only thing you could do is use a string for the inspector, and then parse the value. You could make a custom inspector to ensure that the string is always formatted as a number and doesn't accept other characters.

more ▼

answered Jun 11 '12 at 08:26 PM

Eric5h5 gravatar image

Eric5h5
81.5k 42 133 529

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x482
x28

asked: Jun 11 '12 at 07:10 PM

Seen: 355 times

Last Updated: Jun 11 '12 at 08:26 PM