dg Function

Calculates the contribution ratio, which is based on the sales price and the purchase price.

NoteNote

If the value of the sale parameter is 0.0, the calculation cannot be made.



real dg(real sale, real purchase)

Parameter

Description

sale

The sale price.

purchase

The purchase price.

The contribution ratio.

  • dg(1000,300); //Returns the value 0.7.

  • dg(100,30); //Returns the value 0.7.

  • dg(20000, 11000); //Returns the value 0.45.

Community Additions

ADD
Show: