Post

2 followers Follow
0
Avatar

Integers in REST API

Hi

When a custom numeric field with zero decimals are accessed through REST API, it is sending data with one decimal place with zero as decimal.

Ex:

123.0

5468.0

Ideally, it numeric fields with zero decimal should return whole numbers

Ex:

123

5468

Pranay Muthineni Answered

Please sign in to leave a comment.

1 comment

0
Avatar

Hi Pranay,

The "Decimal Places" setting (in the custom field creation interface) sets the default number of decimal places shown in the UI. This does not mean that the number will be rounded to that many decimal places. The API simply returns the exact number that was inputted. The default number of decimal places when looked via the API is 1, thus the behaviour you're seeing.

I hope this helps.

Roland

Roland Pumputis 0 votes
Comment actions Permalink