# Getrow() - unwanted rounding

**URL:** https://discourse.processing.org/t/getrow-unwanted-rounding/1926
**Category:** Coding Questions
**Created:** [July 20, 2018, 2:08am UTC](https://discourse.processing.org/t/getrow-unwanted-rounding/1926 "2018-07-20T02:08:38Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Groot](https://avatars.discourse-cdn.com/v4/letter/g/82dd89/32.png) [@Groot](https://discourse.processing.org/u/Groot)
#### Post date: [July 20, 2018, 2:08am UTC](https://discourse.processing.org/t/getrow-unwanted-rounding/1926/1 "2018-07-20T02:08:39Z")

</div>

hi all,

ultra new to processing, apologies in advance if this has been asked/is basic.

im trying to read data out of a table that i have imported from a csv file.

i load the table, select a specific row i am interested in then reference the column within that row. Thats all fine, and i am able to extract the number, however the number as been rounded from 10.25 to 10.

does anyone know why this rounding occurs?

Many thanks

Table table;  
table = loadTable(“sample.csv”, “header”);  
TableRow row = table.getRow(3);  
float a =row.getInt(“price”);

println(nf(a, 2, 2));

println(a); //prints 10

---

<div class="post-metadata">

### Author: ![KAZ](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kaz/32/2402_2.png) [@KAZ](https://discourse.processing.org/u/KAZ)
#### Post date: [July 20, 2018, 3:28am UTC](https://discourse.processing.org/t/getrow-unwanted-rounding/1926/2 "2018-07-20T03:28:56Z")

</div>

Try using `float a = row.getFloat("price");`

Also read [https://processing.org/reference/Table\_getFloat\_.html](https://processing.org/reference/Table_getFloat_.html)

---

<div class="post-metadata">

### Author: ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)
#### Post date: [July 20, 2018, 3:48am UTC](https://discourse.processing.org/t/getrow-unwanted-rounding/1926/3 "2018-07-20T03:48:34Z")

</div>

> [@Groot](#):
>
> float a =row.getInt(“price”);

You are using getInt. You need `getFloat()` as mention by @KAZ. Keep the reference handy. If not clear, ask here in the forum.

Kf

---

<div class="post-metadata">

### Author: ![Groot](https://avatars.discourse-cdn.com/v4/letter/g/82dd89/32.png) [@Groot](https://discourse.processing.org/u/Groot)
#### Post date: [July 22, 2018, 8:26pm UTC](https://discourse.processing.org/t/getrow-unwanted-rounding/1926/4 "2018-07-22T20:26:38Z")

</div>

perfect- thanks a lot.
