Skip to content

Fix formatting for times with a very small distance to the full second#67

Merged
krlmlr merged 1 commit intomasterfrom
b-64-print
Mar 25, 2019
Merged

Fix formatting for times with a very small distance to the full second#67
krlmlr merged 1 commit intomasterfrom
b-64-print

Conversation

@krlmlr
Copy link
Member

@krlmlr krlmlr commented Mar 23, 2019

Fully back-compatible. Times slightly below the full second are rounded up and shown with trailing zeros.

library(hms)
hms(0.99999)
#> 00:00:00.99999
hms(0.999999)
#> 00:00:00.999999
hms(0.9999999)
#> 00:00:01.000000
hms(0.99999999)
#> 00:00:01.000000
hms(1.00000001)
#> 00:00:01.000000

Created on 2019-03-24 by the reprex package (v0.2.1.9000)

Closes #64.

@codecov
Copy link

codecov bot commented Mar 23, 2019

Codecov Report

Merging #67 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #67      +/-   ##
==========================================
+ Coverage    99.2%   99.22%   +0.01%     
==========================================
  Files           7        7              
  Lines         126      129       +3     
==========================================
+ Hits          125      128       +3     
  Misses          1        1
Impacted Files Coverage Δ
R/format.R 100% <100%> (ø) ⬆️
R/arith.R 100% <100%> (ø) ⬆️
R/hms.R 97.36% <100%> (ø) ⬆️
R/pillar.R 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 62fdb74...8e9abd2. Read the comment docs.

@codecov
Copy link

codecov bot commented Mar 23, 2019

Codecov Report

Merging #67 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #67      +/-   ##
==========================================
+ Coverage    99.2%   99.24%   +0.03%     
==========================================
  Files           7        7              
  Lines         126      132       +6     
==========================================
+ Hits          125      131       +6     
  Misses          1        1
Impacted Files Coverage Δ
R/arith.R 100% <100%> (ø) ⬆️
R/format.R 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e53d560...e393415. Read the comment docs.

@krlmlr krlmlr requested a review from hadley March 23, 2019 23:47
@hadley
Copy link
Member

hadley commented Mar 25, 2019

I am surprised this required such large changes — I would've thought you'd be able to fix it simply by applying round(x, getOptions("digits")) in the right place in the format method.

@krlmlr
Copy link
Member Author

krlmlr commented Mar 25, 2019

This patch does three things:

It used to do a fourth thing too -- renaming split_second to tic . I extracted this change and applied to master to minimize the diff, but further minimization will require extra work.

@krlmlr krlmlr merged commit fac570a into master Mar 25, 2019
@krlmlr krlmlr deleted the b-64-print branch March 25, 2019 21:40
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

time column in spss is different from time column of the same file imported in R

2 participants