Azure / Azure/cosmos-explorer

Cosmos Explorer discards trailing zeroes from number tokens

Open
#1,482 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
131
Forks
67
Avg merge
3d 13h
Merged PRs (30d)
10

Description

Hi Cosmos Team,

This relates to a Core/SQL cosmos instance.

An interesting edge case, I discovered that explorer will discard trailing zeroes from number tokens in the JSON document.

For example, the object `{ "value": 12345.0000 }` will be shown as 12345 in explorer.
This appears to be an issue with the front-end code that renders out the JSON document with syntax highlighting.
Chrome/Edge devtools show that the Cosmos endpoint is returning the extra digits in the raw payload.

As you may be aware, the `decimal` type in C#/.Net will preserve trailing zeroes like these - and using the Cosmos SDK will correctly roundtrip these values (it's just explorer which is misleading).

Contributor guide

Open the contributing guide

Research direction

Start in the front-end code that renders Cosmos JSON documents with syntax highlighting, comparing displayed number tokens with the raw payload returned by the Cosmos endpoint. Reproduce the example with 12345.0000 and trace where its trailing zeroes are lost; done means Explorer displays the original numeric token without altering the document.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.