thePanz / Twig-Extension-Number

Twig Extension for number formatting for Measure units
6 stars 4 forks source link

format_bytes includes decimal separator for round values #3

Open Drachenkaetzchen opened 9 years ago

Drachenkaetzchen commented 9 years ago

Hi,

first of all: Very cool extension!

I'm having a problem where the format_bytes filter outputs the fraction even if it's not necessary:

{{ storage | format_bytes }}

50.0

I would expect 50 in this case. Is it possible to configure the behavior somehow?

thePanz commented 9 years ago

Seems that format_bytes does not expose any parameter to configure the number decimals to display. Adding it, following the other formatters, should not be too hard. Would you like to provide a PR? :)