We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 916f4dc commit 55fa142Copy full SHA for 55fa142
rust/cubesql/pg-srv/src/values/interval.rs
@@ -36,10 +36,10 @@ impl IntervalValue {
36
}
37
38
pub fn extract_years_month(&self) -> (i32, i32) {
39
- let years = (self.months as f64 / 12_f64).floor();
40
- let month = self.months as f64 - (years * 12_f64);
+ let years = self.months / 12;
+ let month = self.months % 12;
41
42
- (years as i32, month as i32)
+ (years, month)
43
44
45
pub fn as_iso_str(&self) -> String {
0 commit comments