I currently use this pipe {{ product.productPrice | number:'.2-2' }}
And result is 1,000,000.00 but I want to remove the .00
How do you do that?
I currently use this pipe {{ product.productPrice | number:'.2-2' }}
And result is 1,000,000.00 but I want to remove the .00
How do you do that?
Use this :
{{product.productPrice | number: '1.0-0'}}
1.0-0 means: at least one digit before decimal point, 0 digits after decimal point.
The general format is:
{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}
minIntegerDigits: The minimum number of integer digits before the decimal point. Default is 1.
minFractionDigits: The minimum number of digits after the decimal point. Default is 0. maxFractionDigits: The maximum number of digits after the decimal point. Default is 3.
-1.75
should be 1
, not 2
? –
Turbid Math.trunc()
. –
Turbid Main.ts
and polyfill.ts
files, however there is no Math.trunc()
. May be this file is not saved. Could you post here your code? –
Turbid © 2022 - 2024 — McMap. All rights reserved.