瀏覽代碼

util: convert u32 to u64

lunar-mining 4 年之前
父節點
當前提交
c784d0396c
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/util/parse.rs

+ 4 - 1
src/util/parse.rs

@@ -157,7 +157,8 @@ pub fn symbol_to_id(token: &str, tokenlist: TokenList) -> Result<String> {
 //        amount_vec.push(digit);
 //        amount_vec.push(digit);
 //    }
 //    }
 //
 //
-//    Ok(amount_vec.drain())
+//    let amount: u64 = amount_vec.drain();
+//    Ok(amount)
 //}
 //}
 
 
 mod tests {
 mod tests {
@@ -185,6 +186,7 @@ mod tests {
         };
         };
 
 
         println!("Removed decimal point: {}", amount);
         println!("Removed decimal point: {}", amount);
+
         // only digits should remain:
         // only digits should remain:
         for c in amount.chars() {
         for c in amount.chars() {
             if c.is_digit(RADIX) == false {
             if c.is_digit(RADIX) == false {
@@ -222,6 +224,7 @@ mod tests {
         for i in amount.chars() {
         for i in amount.chars() {
             let digit = i.to_digit(RADIX).unwrap();
             let digit = i.to_digit(RADIX).unwrap();
             println!("Converted to integer: {}", digit);
             println!("Converted to integer: {}", digit);
+            let u = u64::from(digit);
         }
         }
     }
     }