mirror of
https://git.alemi.dev/mood.git
synced 2024-11-14 04:49:19 +01:00
fix: should be a float...
This commit is contained in:
parent
acc8824600
commit
2d5ab36f67
1 changed files with 2 additions and 2 deletions
|
@ -34,7 +34,7 @@ fn main() {
|
|||
pool.reserve(sum as usize);
|
||||
for (count, line) in lines {
|
||||
for _ in 0..count {
|
||||
pool.push((line, count / sum));
|
||||
pool.push((line, count as f32 / sum as f32));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,5 +42,5 @@ fn main() {
|
|||
|
||||
println!("Content-type: application/json");
|
||||
println!();
|
||||
println!("{{\"id\":{},\"mood\":\"{}\",\"chance\":{}}}", index, choice, chance);
|
||||
println!("{{\"id\":{},\"mood\":\"{}\",\"chance\":{:.3}}}", index, choice, chance);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue