-
Hello, how can i change "float" precision in Code, not on site? like here #1386 |
Beta Was this translation helpful? Give feedback.
Answered by
texodus
Jun 23, 2021
Replies: 1 comment 1 reply
-
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
const worker = window.perspective.worker({
types: {
float: {
format: {
style: "decimal",
minimumFractionDigits: 6,
maximumFractionDigits: 6
}
}
}
});
token = document.querySelector("perspective-viewer#one").save(); // will be `async` in `0.10.0`
// ... later ...
document.querySelector("perspective-viewer#two").restore(token); If you'd like, you can inspect this token and customize the |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
texodus
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
+.perspective config
, like thisplugin_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 bysave()
from the JS Console, copy this object and use it as an argument torest…