Skip to content

Commit

Permalink
Number precision (#89)
Browse files Browse the repository at this point in the history
* Scientific notation for FLOAT and DOUBLE

* Set max number of nodes to expand on double click

* Run linters

---------

Co-authored-by: Lint Bot <[email protected]>
  • Loading branch information
mewim and mewim authored Feb 23, 2024
1 parent a3ee1a4 commit a4f1762
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/components/SettingsView/SettingsMainView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,17 @@
max="2000"
>
</div>
<div class="input-group flex-nowrap">
<span class="input-group-text">Max number of nodes to expand on double click</span>
<input
v-model="currentSettings.performance.maxNumberOfNodesToExpand"
type="number"
class="form-control"
title="Choose max number of nodes to expand on double click"
min="5"
max="1000"
>
</div>

<br>
<h4>Schema View Options</h4>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/ValueFormatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class ValueFormatter {
moment.utc();
return moment.format();
} else if (type === DATA_TYPES.FLOAT || type === DATA_TYPES.DOUBLE) {
return Number(value).toFixed(2);
return Number.parseFloat(value).toExponential();
} else {
[DATA_TYPES.FIXED_LIST, DATA_TYPES.VAR_LIST].forEach((dataType) => {
if (type.startsWith(dataType)) {
Expand Down

0 comments on commit a4f1762

Please sign in to comment.