Skip to content

Instantly share code, notes, and snippets.

@matsimitsu
Created December 17, 2016 00:02
Show Gist options
  • Save matsimitsu/b839892c7f28192a83faf616661db730 to your computer and use it in GitHub Desktop.
Save matsimitsu/b839892c7f28192a83faf616661db730 to your computer and use it in GitHub Desktop.
fn main() {
let str = "000030.294";
let float: f32 = str.parse().unwrap();
println!("{:?}", float);
}
// Running this on a Raspberry Pi returns:
//pi@raspberrypi ~ $ RUST_BACKTRACE=1 ./p1-monitor
//0.000000000000000000000000000000000000000000042
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment