main
1namespace solidware.financials.service.domain.payroll
2{
3 public class Units
4 {
5 static public readonly Units Empty = new Units();
6 Units() {}
7
8 static public Units New(int units)
9 {
10 return new Units {units = units};
11 }
12
13 public Money value_at(decimal price)
14 {
15 return price*units;
16 }
17
18 public Units combined_with(Units other)
19 {
20 return New(units + other.units);
21 }
22
23 public Units reduced_by(Fraction portion)
24 {
25 return New(portion.of(units));
26 }
27
28 int units;
29 }
30}