# Unable to convert object to a number

**URL:** <https://discourse.psychopy.org/t/unable-to-convert-object-to-a-number/44115>\
**Category:** Online experiments\
**Created:** [March 4, 2025, 3:38pm UTC](https://discourse.psychopy.org/t/unable-to-convert-object-to-a-number/44115 "2025-03-04T15:38:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![IRIO](https://avatars.discourse-cdn.com/v4/letter/i/c5a1d2/32.png) [@IRIO](https://discourse.psychopy.org/u/IRIO)\
**Post date:** [March 4, 2025, 3:38pm UTC](https://discourse.psychopy.org/t/unable-to-convert-object-to-a-number/44115/1 "2025-03-04T15:38:05Z")

</div>

If this template helps then use it. If not then just delete and start from scratch.

**OS** : Win10  
**PsychoPy version** : 2024.2.4  
**Standard Standalone Installation? (y/n)** If not then what?:  
\*\*URL of experiment: \*\* [Sign in · GitLab](https://gitlab.pavlovia.org/IRIO/test_online_visual1)[stim\_presentation [PsychoPy]](https://run.pavlovia.org/IRIO/test_online_visual1/? __pilotToken=9bf31c7ff062936a96d3c8bd1f8f2ff3&__ oauthToken=5f1a3613db6caf93da4e29ee31dbbcdbe3f0582a8325235b2c99e7fc75974650)

Hello, I built an experiment in Builder where images are shown iteratively inside a circle. Positions (in cm) are updated at each repeat using the coordinates saved in a condition.xlsx file.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/2/e/2e2f787eabb9edc19997100aab794705314370c0.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/5/e/5e6518b68c227d9b844249b172659dcda8b25d2a.png)

This is the error I get, which is linked to the conversion of coordinates from the excel file:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/6/1/61a135b1d90865b2539add18adacaba6c88d6c59.png)

I don’t know how to solve this because the previous threads deal with problems linked to code components, while in my script I have no code components at all.

Thank you a lot for the help,  
Best wishes,  
Isotta

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [March 4, 2025, 3:46pm UTC](https://discourse.psychopy.org/t/unable-to-convert-object-to-a-number/44115/2 "2025-03-04T15:46:20Z")

</div>

The easiest solution is to have two columns in your spreadsheet (fig\_posx and fig\_posy) and then set the position as `(fig_posx, fig_posy)`. No dollar sign is needed.

---

<div class="post-metadata">

**Author:** ![IRIO](https://avatars.discourse-cdn.com/v4/letter/i/c5a1d2/32.png) [@IRIO](https://discourse.psychopy.org/u/IRIO)\
**Post date:** [March 4, 2025, 3:57pm UTC](https://discourse.psychopy.org/t/unable-to-convert-object-to-a-number/44115/3 "2025-03-04T15:57:24Z")

</div>

If I do this, I don’t have this problem anymore indeed. However, I get another error, linked to the unit of measurements:

Error

Unfortunately we encountered the following error:

- when converting a position to pixel units
- **unknown position units: cm**

As mentioned before, the units for the images are all in cm…is this not allowed for online experiments? Moreover, could this be due to a mismatch cause by the fact that the experiment setting for “Screen” are in height?

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [March 4, 2025, 4:05pm UTC](https://discourse.psychopy.org/t/unable-to-convert-object-to-a-number/44115/4 "2025-03-04T16:05:13Z")

</div>

cm can’t work online, because the browser doesn’t know the size of the monitor.

> [@Wakefield's Daily Tips](https://discourse.psychopy.org/t/wakefields-daily-tips/43371/22):
>
> Use height units If you are using a head rest or controlled environment where you have set up the monitor details in the PsychoPy monitor centre then feel free to use cm or degrees. This is particularly recommended if you are presenting stimuli to two screens. On the other hand, if you aren’t controlling the distance between the participant and the computer or are running your study online, I would recommend using height units rather than pix or norm. In norm units the screen is 2 x 2 (bottom …

# ScreenScale [code](https://gitlab.pavlovia.org/Wake/screenscale) | [try it](https://pavlovia.org/run/Wake/screenscale/) | [discussion thread](https://discourse.psychopy.org/t/scalescreen-cc-screen-dimensions-from-pix-to-norm/20331)

Use to ask a participant to work out their screen scale relative to a credit card.  
Morys-Carter, W. L. (2021, May 18). _ScreenScale_ [Computer software]. Pavlovia. [OSF](https://doi.org/10.17605/OSF.IO/8FHQK)
