mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Fix/keep two decimals for stability (#2873)
* Fix/keep two decimals * update test
This commit is contained in:
parent
27b2bce604
commit
96ae3dce48
1 changed files with 2 additions and 2 deletions
|
@ -79,7 +79,7 @@ impl CardData {
|
|||
|
||||
pub(crate) fn convert_to_json(&mut self) -> Result<String> {
|
||||
if let Some(v) = &mut self.fsrs_stability {
|
||||
round_to_places(v, 1)
|
||||
round_to_places(v, 2)
|
||||
}
|
||||
if let Some(v) = &mut self.fsrs_difficulty {
|
||||
round_to_places(v, 3)
|
||||
|
@ -163,7 +163,7 @@ mod test {
|
|||
};
|
||||
assert_eq!(
|
||||
data.convert_to_json().unwrap(),
|
||||
r#"{"s":123.5,"d":1.235,"dr":0.99}"#
|
||||
r#"{"s":123.46,"d":1.235,"dr":0.99}"#
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue