Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time: fix string representation of negative Duration #21407

Merged
merged 1 commit into from May 3, 2024

Conversation

hholst80
Copy link
Contributor

@hholst80 hholst80 commented May 2, 2024

Closes #20965

@hholst80
Copy link
Contributor Author

hholst80 commented May 2, 2024

@JalonSolov how do you think negative Duration should be represented as strings? just prefix with a '- ' like in debug string representation?

vlib/time/duration.v Outdated Show resolved Hide resolved
@JalonSolov
Copy link
Contributor

@JalonSolov how do you think negative Duration should be represented as strings? just prefix with a '- ' like in debug string representation?

It should look like a negative number you typed in, so -10, not - 10 - that looks like you're trying to subtract 10 from something.

@hholst80 hholst80 force-pushed the negative-duration branch 2 times, most recently from 5f6a353 to 90f790c Compare May 3, 2024 13:16
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work.

@spytheman spytheman merged commit 4cb5949 into vlang:master May 3, 2024
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vlib: time.Duration and - operator leaves spurious ns reminder for a - b < 0 case.
3 participants