Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make several refactoring improvements to some
format_*()
functions (#…
…244) * Add comment with a TODO * Refactor stmt in `fmt_percent()` * Remove unneeded stmt * Use different function call * Remove unneeded util function * Remove unneeded components in `switch()` * Remove unneeded util function * Remove extra space * Update several testthat tests * Make handling of parentheses consistent * Rename `paste_currency_str()` to be general * Use the `paste_symbol_str()` util fcn * Create a common `symbol_str` variable * Modify several testthat tests * Add the `perform_negative_formatting()` fcn * Simplify negative value formatting * Modify the `to_latex_math_mode()` fcn * Modify calls to `to_latex_math_mode()` * Incorporate `minus_mark` in `paste_symbol_str()` * Add a function factory for some `format_*()` fcns * Define the formatter `type` for some `format_*()` fcns * Remove `negative_val` arg in some `format_*()` fcns * Use the `num_formatter_factory()` fcn factory * Update help files using roxygen * Remove several unneeded testthat tests * Modify argument name * Update repeated function calls * Modify function name * Modify comment * Modify conditional statement * Update argument in function signature * Modify variable assignment * Modify function called * Update help file using roxygen * Update several testthat tests * Remove `x` from fcn signature * Modify roxygen documentation * Set default values * Reverse order of args in fcn signature * Update help file using roxygen * Add argument to fcn signature * Remove unneeded util function * Return early in certain circumstances * Reverse order of args in fcn signature * Use `x` in fcn body instead of `x_str_vals` * Add the `prettify_scientific_notation()` util fcn * Add a `force()` call for each arg * Refactor the `num_formatter_factory()` fcn * Avoid assigning the `type` variable * Call the `normalize_suffixing_inputs()` fcn * Modify all `num_formatter_factory()` calls * Modify two testthat tests * Modify roxygen documentation * Update help files using roxygen * Remove default `NULL` values in fcn signature * Apply series of transformations with `%>%` * Assign logical vector `x_vals_lt0` for reuse * Force all arguments using a list * Move references of `currency` to `symbol` * Use `symbol` in place of `currency` * Add roxygen documentation and comments * Modify roxygen documentation * Update help files using roxygen * Validate a non-NULL locale right away * Modify function name * Simplify signature of `num_fmt_factory()` * Extract variables from `var_list` * Add the `create_var_list()` util fcn * Remove unneeded code * Simplify transformations in function factory * Modify function signatures * Generate `sep|dec_mark` within function factory * Refactor several `fmt_*()` functions * Modify function signature * Use `num_fmt_factory_multi()` throughout * Add roxygen documentation * Remove the `contexts` arg * Refactor `fmt_*()` fcns * Refactor `fmt_*()` fcns * Tidy code and add roxygen documentation * Additional refactoring for `format_*()` functions (#260) * Get `minus_mark` just before usage * Get `parens_marks` just before usage * Get `symbol_str` just before usage
- Loading branch information