[FR] Option for morph-file-size to specify decimal places
See original GitHub issueAs a user of the morph-file-size
filter I’d like to add fa ormatting option/directive on how many digits shall be rendered for the decimal place.
Example
<code>{{ 1048576 | morph-file-size }}</code>
renders to 1.0 Mb
.
I’d like this to be rendered as 1 Mb
so it’d be nice to have something like:
<code>{{ 1048576 | morph-file-size(0) }}</code>
renders to 1 Mb
.
<code>{{ 1048576 | morph-file-size(2) }}</code>
renders to 1.00 Mb
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Round a number to the decimal places I want - Microsoft Support
Select the cells that you want to format. On the Home tab, click Increase Decimal or Decrease Decimal to show more or fewer...
Read more >Formatting Decimal places in R - Stack Overflow
You can format a number, say x , up to decimal places as you wish. Here x is a number with many decimal...
Read more >Angular Decimal Pipe & formatting decimal numbers in ...
Learn how to format numbers in Angular using Angular Decimal Pipe ... pipe will take default options, 1 interger value before decimal point...
Read more >Format Number of Decimal Places in R - GeeksforGeeks
Format () function can be used to format decimal values by rounding them and displaying only a specific number of elements after decimal....
Read more >Format numeric values — fmt_number • gt - RStudio
Furthermore, there is finer control over numeric formatting with the following options: decimals: choice of the number of decimal places, option to drop ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Gotcha buddy! @straurob
Glad I saw your comment just in time as I already started working on a PR 😃 Passing in the options from
filesize
works.Thanks a lot for the quick fix.