-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ui: Redundant query request fix #3331
Conversation
Works perfectly now! Thanks for taking care of this! Looks like some lint is failing otherwise lgtm |
@@ -15,7 +15,7 @@ | |||
* Divides two bigints and returns a number with two decimal places | |||
*/ | |||
export const divide = (a: bigint, b: bigint): number => { | |||
return Number((a * 10000n) / b) / 10000; | |||
return Number((a * 1000000n) / b) / 1000000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of curiosity, why did the value being multiplied by change here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since bigint
divisions don't give any decimals, we premultiply it by 1M and then divide the result again by 1M to get the result with decimals.
I increased the number from 10K to 1M to get more precision to the decimal part, which was needed for the linearScale
function.
Hope it answers the question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! just a question about a change in value below.
Contains the following:
nodeThreshold
.@parca/hooks
package version drift from the the consumed version.linearScale
scale function.Resolves #2823