# Difference not right, because number format?

**URL:** <https://community.influxdata.com/t/difference-not-right-because-number-format/29523>\
**Category:** InfluxDB 2\
**Tags:** influxdb, query\
**Created:** [April 17, 2023, 8:07am UTC](https://community.influxdata.com/t/difference-not-right-because-number-format/29523 "2023-04-17T08:07:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shms](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@shms](https://community.influxdata.com/u/shms)\
**Post date:** [April 17, 2023, 8:07am UTC](https://community.influxdata.com/t/difference-not-right-because-number-format/29523/1 "2023-04-17T08:07:38Z")

</div>

Hello i´m a newbie in InfluxDb, i have a problem and i think the problem is the number format, but i think the raw data are in the right format.

The problem is that i want to do the difference between two entrys (for a consumtion analytic), but the difference is to small between two entrys. Attached are Screenshots. The frist screenshot are the raw data, and the second screenshot are the data where i get vom InfluxDBGui.

Now i do the difference and the difference is smaller then 0,0009…  
if you look at the data from InfluxDBGui there are 5.931,36 an now i think they do the difference after the komma (,) and not the hole number.

Why is in the InfluxDBGui the Number like this? and not like Raw Data Entrys?

Thanks for your helb 🙂

 ![dbdb](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/1/1640d0cdf0d702f74dd3eb04c2e59374e611a19f.png)

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [April 17, 2023, 11:39pm UTC](https://community.influxdata.com/t/difference-not-right-because-number-format/29523/2 "2023-04-17T23:39:44Z")

</div>

Hello @shms,  
You can change the decimal representation in the table in the GUI by going to settings \> decimal value.

I think that will solve your problem. Let me know!

Please see this:

> [@Dashboard - Table - "Decimal Places" not respected](https://community.influxdata.com/t/dashboard-table-decimal-places-not-respected/25347):
>
> Dashboard Table representations do not respect the “Decimal Places” setting under Customization. Is there any way to force this, or to round values within Flux? (Looking for two decimal places.)

I think it’s related

---

<div class="post-metadata">

**Author:** ![shms](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@shms](https://community.influxdata.com/u/shms)\
**Post date:** [April 21, 2023, 5:21pm UTC](https://community.influxdata.com/t/difference-not-right-because-number-format/29523/3 "2023-04-21T17:21:15Z")

</div>

Hallo Anaisdg,

thanks for your answer. But this was not the problem. I solved it, but I don’t know why this is working.

First i try to calculate the difference like this  
……  
|\> difference()  
|\> aggregateWindow(every: 1d, fn: last, createEmpty: false)  
…  
Now I changed the difference() after the aggregateWindow and it works???

Now I have one more question. 🙂

I have two measurements with 1 value. I would like to subtract the measurements 1 from the measurements 2 value, how does it works? In google i only find ways to do this with 2 Values in one measurements.

Thanks shms
