We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
When I use cm as units. It creates long numbers with decimals. Imo this should be rounded away.
Here is the diff that solved my problem:
diff --git a/node_modules/@scena/react-ruler/src/react-ruler/Ruler.tsx b/node_modules/@scena/react-ruler/src/react-ruler/Ruler.tsx index 8a32e3e..946fa48 100644 --- a/node_modules/@scena/react-ruler/src/react-ruler/Ruler.tsx +++ b/node_modules/@scena/react-ruler/src/react-ruler/Ruler.tsx @@ -163,10 +163,10 @@ export default class Ruler extends React.PureComponent<RulerProps> implements Ru ? [startPos + alignOffset * -3, isDirectionStart ? 17 : height - 17] : [isDirectionStart ? 17 : width - 17, startPos + alignOffset * 3]; - let text = `${value * unit}`; + let text = String(Math.round(value * unit)); if (textFormat) { - text = textFormat(value * unit); + text = textFormat(text); } context.textAlign = textAlign;
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered:
@ram4nd
usetextFormat prop.
textFormat
textFormat={value => Math.round(value)}
Sorry, something went wrong.
No branches or pull requests
When I use cm as units. It creates long numbers with decimals. Imo this should be rounded away.
Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: