Skip to content

Commit

Permalink
fix formatting bug when number equal to 0 in etable, fixes #504
Browse files Browse the repository at this point in the history
  • Loading branch information
lrberge committed Jun 11, 2024
1 parent e129de8 commit 940533f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
6 changes: 4 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

# fixest 0.12.1

# Major bugs affecting R versions <= 4.1.2
## Major bugs affecting R versions <= 4.1.2

- require `stringmagic` version >= 1.1.2 to fix several major bugs affecting R versions <= 4.1.2

# Bugs
## Bugs

- fix bug leading to CRAN error (in IV with fixed-effects and no exogenous variable)

Expand All @@ -21,6 +21,8 @@

- fix bug in `etable` when variables appeared in the statistics and those variables contained invalid Latex characters. PR by @MaelAstruc, #508

- fix formatting for coefficients/statistics equal to 0. Reported by @MaelAstruc, #504

# fixest 0.12.0

## New features
Expand Down
2 changes: 1 addition & 1 deletion R/miscfuns.R
Original file line number Diff line number Diff line change
Expand Up @@ -5790,7 +5790,7 @@ format_nber_single = function(x, digits, round = FALSE, pow_above = 10, pow_belo
}
}

exponent = floor(log10(abs(x)))
exponent = if(x == 0) -16 else floor(log10(abs(x)))

if(exponent >= pow_above || exponent <= pow_below){
left_value = round(x*10**-exponent, min(digits, 2))
Expand Down
15 changes: 15 additions & 0 deletions docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 940533f

Please sign in to comment.