mmooyyii commented on issue #16406:
URL: https://github.com/apache/datafusion/issues/16406#issuecomment-2974920966

   ```
   use bigdecimal::num_bigint::BigInt;
   use bigdecimal::{BigDecimal};
   use std::fs;
   
   fn main() {
       let f = fs::read_to_string("/tmp/decimal.csv").unwrap();
       let mut acc = BigDecimal::new(BigInt::from(0), 20);
       for line in f.split("\r\n") {
           if line.is_empty() {
               continue;
           }
           let x = line.split(",").collect::<Vec<&str>>();
           let d1 = x[0].parse::<BigDecimal>().unwrap().with_scale(10);
           let d2 = x[1].parse::<BigDecimal>().unwrap().with_scale(10);
           acc += d1 * d2;
       }
       print!("{}\n", acc); // 3318680488765741748.46645774090000000000
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to