mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:37:46 +00:00
Calculator: Add a Shrinking action
This action allow the user to shrink a number to a finite number of decimal.
This commit is contained in:
parent
e3b22c395d
commit
2ff773a6ba
7 changed files with 32 additions and 7 deletions
|
@ -145,3 +145,8 @@ unsigned Keypad::rounding_length() const
|
|||
{
|
||||
return m_displayed_fraction_length;
|
||||
}
|
||||
|
||||
void Keypad::shrink(unsigned shrink_threshold)
|
||||
{
|
||||
m_internal_value = m_internal_value.rounded(shrink_threshold);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue