You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So the way to use the available options is pretty straightforward in Angular.
Here is a snippet of what I have currently:
return new FileSizePipe().transform(bytes, { locale: 'fr-FR' );
where bytes is the file size I wish to transform using the pipe and fr-FR is the language I wish to use. Locale is cool because it automatically deduces what separator to use, but what it doesn't do is change the symbols. Example: Kb, Mb, etc...
In french, it's Ko, Mo, etc...
How can I use the symbols options to define my own set of symbols to be used?
So the way to use the available options is pretty straightforward in Angular.
Here is a snippet of what I have currently:
return new FileSizePipe().transform(bytes, { locale: 'fr-FR' );
where
bytes
is the file size I wish to transform using the pipe andfr-FR
is the language I wish to use. Locale is cool because it automatically deduces what separator to use, but what it doesn't do is change the symbols. Example: Kb, Mb, etc...In french, it's Ko, Mo, etc...
How can I use the symbols options to define my own set of symbols to be used?
This is what I tried to do but failed miserably:
return new FileSizePipe().transform(bytes, { locale: 'fr-FR', symbols: { Kb: 'Ko', Mb: 'Mo' } } );
Also
const sij: SiJedec = { KB: 'KO', Kb: 'Ko', Gb: 'Go', GB: 'GO' };
return new FileSizePipe().transform(bytes, { locale: 'fr-FR', symbols: sij } );
Can anyone help me please? Thanks in advance.
@amitdahan @majora2007 @richardlnnr
The text was updated successfully, but these errors were encountered: