couchbase / couchbase/couchdb

Float problem.

Open
#7 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Erlang
Stars
142
Forks
58
PR merge metrics
No merged PRs in 30d

Description

When entering a float value such as 1.0 via the CouchDB interface, the value is stored and recognized internally as a float. However, the interface displays this value as an integer (1). This leads to a mismatch where some migrations or applications expect a float type, but the interface shows an integer, causing confusion and potential errors in workflows relying on strict type distinctions.

Steps to reproduce:

Insert or update a document field with a float value, e.g., 1.0, using the CouchDB web interface.

Save the document.

Reload or view the document again in the interface.

Observe that the value is displayed as 1 (integer) instead of 1.0 (float), although internally it is treated as a float.

Expected behavior:
The interface should display the value exactly as stored, preserving the float format (1.0) when applicable, to avoid confusion and ensure consistency with backend data types.

Actual behavior:
The interface converts or formats the float value 1.0 to integer 1 when displaying it, while internally keeping it as a float.

Impact:
This inconsistency causes problems in systems that rely on type-specific values, such as migrations or applications that expect floats or integer. It can lead to bugs or data handling errors due to incorrect assumptions about the data type.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by reproducing the issue in the CouchDB web interface with a value such as 1.0, then trace the interface's value-display path and its existing tests. Done means a stored float is shown with its float representation after saving and reloading, without changing other numeric values.

Written by the indexing model from the issue text.

Assessment

Tech stack
erlang
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.