question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FR] Option for morph-file-size to specify decimal places

See original GitHub issue

As 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:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jofftiquezcommented, May 13, 2020

Gotcha buddy! @straurob

1reaction
straurobcommented, May 13, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found