docs: fix the century algorithm example in docs.md (#7549)

pull/7561/head^2
3RM1N3 2020-12-25 09:19:00 -06:00 committed by GitHub
parent 72b0421f3e
commit fdf6927585
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -747,11 +747,12 @@ However, you _can_ redeclare a type.
```v
import time
import math
type MyTime = time.Time
fn (mut t MyTime) century() int {
return 1 + t.year % 100
return int(1.0 + math.trunc(f64(t.year) * 0.009999794661191))
}
fn main() {