# Perspective: Forcing a property value to a particular type

**URL:** <https://forum.inductiveautomation.com/t/perspective-forcing-a-property-value-to-a-particular-type/39007>\
**Category:** Ignition\
**Tags:** ignition80, perspective\
**Created:** [September 24, 2020, 2:12am UTC](https://forum.inductiveautomation.com/t/perspective-forcing-a-property-value-to-a-particular-type/39007 "2020-09-24T02:12:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 24, 2020, 2:12am UTC](https://forum.inductiveautomation.com/t/perspective-forcing-a-property-value-to-a-particular-type/39007/1 "2020-09-24T02:12:58Z")

</div>

How do I force a property value to a particular type and avoid the automatic type casting?

I’m getting an error setting the `props.text`value of a checkbox to the infinity symbol due to it recognising infinity as a number instead of as text…

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/f/ff4eb0e777d5b2fef1a7913e29c6022d43dacc73.png)

I’ve had other instances as well where I don’t want it to convert numerals to a number type instead of a string.  
In this case I can simply add a space character at the end.

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [September 24, 2020, 3:05am UTC](https://forum.inductiveautomation.com/t/perspective-forcing-a-property-value-to-a-particular-type/39007/2 "2020-09-24T03:05:08Z")

</div>

If you did this with an expression binding of `”∞”` it should work

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 24, 2020, 3:07am UTC](https://forum.inductiveautomation.com/t/perspective-forcing-a-property-value-to-a-particular-type/39007/3 "2020-09-24T03:07:02Z")

</div>

Ah… well that’s more obvious than I care to admit 😅  
Cheers!

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [September 24, 2020, 5:55am UTC](https://forum.inductiveautomation.com/t/perspective-forcing-a-property-value-to-a-particular-type/39007/4 "2020-09-24T05:55:17Z")

</div>

Was it truly an error, or was it just a warning? Warnings can almost always be ignored. They’re more like guidelines.

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [September 24, 2020, 6:15am UTC](https://forum.inductiveautomation.com/t/perspective-forcing-a-property-value-to-a-particular-type/39007/5 "2020-09-24T06:15:01Z")

</div>

> [@cmallonee](#):
>
> Warnings can almost always be ignored.

It would be nice if instead of a warning and an error sharing the same “red triangle” on the props menu, for a warning to show a yellow symbol similar to in the logs. Makes us feel like we need to fix it, because we never know what “error” that works now would get “fixed” in a future patch

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 24, 2020, 6:20am UTC](https://forum.inductiveautomation.com/t/perspective-forcing-a-property-value-to-a-particular-type/39007/6 "2020-09-24T06:20:06Z")

</div>

I couldn’t leave the entry there. Pressing enter didn’t set it, clicking out of the value entry reverted it back to the old value, so i guess it was an error?

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [September 24, 2020, 6:27am UTC](https://forum.inductiveautomation.com/t/perspective-forcing-a-property-value-to-a-particular-type/39007/7 "2020-09-24T06:27:53Z")

</div>

> [@nminchin](#):
>
> recognising infinity as a number instead of as text…

This is separate, but I have to say it is wild that this works this way. I am very surprised the ascii character for the infinity symbol is accepted as a numeric value directly, not at all what I would have expected there. Technically correct, just not what I would have expected

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 24, 2020, 6:35am UTC](https://forum.inductiveautomation.com/t/perspective-forcing-a-property-value-to-a-particular-type/39007/8 "2020-09-24T06:35:37Z")

</div>

it’s pretty cool, I noticed it when I was dividing by 0 the resulting value was the infinity symbol 🙂
