Anish
Anish

Reputation: 768

How to retain two decimal points in flex using Math.round()

How to retain two decimal points in flex using Math.Round

code:

txtTotal.text=Math.round((Number(txtRate.text)*Number(txtQuantity.text))).toString();

here the rate is a constant 1.1 and quantity is variable ie rate*quantity=1.1 * quantity

Upvotes: 1

Views: 7424

Answers (1)

IAmMearl
IAmMearl

Reputation: 487

Instead of .toString(), use .toFixed(2);

Upvotes: 4

Related Questions