Skip to content

Change "float" precision in Code #1458

Answered by texodus
Sorry777 asked this question in Q&A
Discussion options

You must be logged in to vote

There are two APIs for this available currently, both work but you likely want the latter (2) option if you're using a new enough Perspective to support it 0.7.0+.

  1. Use perspective config, like this
const worker = window.perspective.worker({
    types: {
        float: {
            format: {
                style: "decimal",
                minimumFractionDigits: 6,
                maximumFractionDigits: 6
            }
        }
    }
});
  1. Use plugin_config which is the serialized state of the user-controllable precision in #1386 . Just configure the grid using the UI controls, then use the token returned by save() from the JS Console, copy this object and use it as an argument to rest…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Sorry777
Comment options

Answer selected by texodus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants