mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -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> {
|
pub(crate) fn convert_to_json(&mut self) -> Result<String> {
|
||||||
if let Some(v) = &mut self.fsrs_stability {
|
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 {
|
if let Some(v) = &mut self.fsrs_difficulty {
|
||||||
round_to_places(v, 3)
|
round_to_places(v, 3)
|
||||||
|
@ -163,7 +163,7 @@ mod test {
|
||||||
};
|
};
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
data.convert_to_json().unwrap(),
|
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