# Bug with lookup expression on double?

**URL:** <https://forum.inductiveautomation.com/t/bug-with-lookup-expression-on-double/88147>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [April 1, 2024, 2:04pm UTC](https://forum.inductiveautomation.com/t/bug-with-lookup-expression-on-double/88147 "2024-04-01T14:04:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 1, 2024, 2:04pm UTC](https://forum.inductiveautomation.com/t/bug-with-lookup-expression-on-double/88147/1 "2024-04-01T14:04:34Z")

</div>

Using 8.1.26.

I have a dataset `travelMatrix` as a custom property on the root container that looks like this - onewaycost with a column type double.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/8/789885622ea1aaf98834165e3a3903ca4cb48798.png)

I have another custom property where I try to extract this `76.56` value.

I first tried extracting it with a `lookup` function like this `lookup({Root Container.travelMatrix}, 3879, -1, 'userId', 'onewaycost')` but this kept rounding the value to 77.0. I thought maybe it was just truncating for viewing purposes but binding this value to a numeric text field .double property it does come through at 77.0.

Accessing it directly with `try({Root Container.travelMatrix}[3,'onewaycost'],-1.0)` does work and I see 76.56, as does using @pturmel 's view function and doing something like `try(view("SELECT onewaycost WHERE userId==3879",{Root Container.travelMatrix})[0,0],-1)`. But trying to use the lookup function it keeps rounding it without fail.

Not sure if this is expected behavior or if I am missing something here about using lookup for double/float values - it does say lookup returns `object` so I thought it wouldn't matter if it was a float/double etc.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 1, 2024, 2:08pm UTC](https://forum.inductiveautomation.com/t/bug-with-lookup-expression-on-double/88147/2 "2024-04-01T14:08:54Z")

</div>

You are supplying an integer fallback value. The datatype of the fallback value determines the return datatype. Make sure your fallback value has a decimal point.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 1, 2024, 2:10pm UTC](https://forum.inductiveautomation.com/t/bug-with-lookup-expression-on-double/88147/3 "2024-04-01T14:10:19Z")

</div>

Whoops. I somehow remembered to provide a -1.0 for the `try` directly but not my lookup. Appreciate it!
