linebender / druid

A data-first Rust-native UI design toolkit.
https://linebender.org/druid/
Apache License 2.0
9.57k stars 566 forks source link

```self.value.push('.')``` calculator . fix __display #2388

Closed YoungHaKim7 closed 1 year ago

YoungHaKim7 commented 1 year ago

ex )

  1. 3

If you press 36.3, 36 is followed by 3. I think this is better.

89            '.' => {
90                if !self.in_num {
91                    self.value.push('.');
92                    self.in_num = true;
93                }
xStrom commented 1 year ago

I can not reproduce the bug you are describing.

Also, this patch breaks the following sequence: 2 x . 5 = by giving the answer 5 instead of 1.

Do you still get 1 as the answer to this test?

YoungHaKim7 commented 1 year ago

66                 if self.in_num {
                    self.value = "0".to_string();
                    self.in_num = true;
                }

It's my mistake. I'm sorry. I skipped an exclamation point on the 66th line. I'm sorry. I'll close it.