mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Show fractal in relative_sequence_number if present
This commit is contained in:
parent
685c79d673
commit
d0fe7f54f6
3 changed files with 20 additions and 6 deletions
|
|
@ -192,3 +192,13 @@ pub fn parse_resolution(mut resolution: String) -> Result<Resolution> {
|
|||
bail!("Could not find resolution")
|
||||
}
|
||||
}
|
||||
|
||||
/// Dirty implementation of [`f32::fract`] with more accuracy.
|
||||
pub fn fract(input: f32) -> f32 {
|
||||
if input.fract() == 0.0 {
|
||||
return 0.0;
|
||||
}
|
||||
format!("0.{}", input.to_string().split('.').last().unwrap())
|
||||
.parse::<f32>()
|
||||
.unwrap()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue