Each 'unit' is scaled.
Then all the units are compared.
E.g.
Scaled marks:
English: 42/50
MX1: 49/50
MX2: 48/50
Jap Cont: 45/50
Jap Ext: 47/50
Physics: 44/50
In the bold, Jap Cont will count for 2 units.
Now Physics is 44, but has a total of 88 if counted as a '2u' subject.
But Jap Ext is better than Physics, so Physics will ONLY count for 44, and Jap Xt will count for 47.
Therefore your total aggregate is 42x2 + 49x2 + 48x2 + 45x2 + 47 + 44 = 459.
So all that hard work in Jap Xt has paid off! You get 3 extra points to your aggregate.
Anyway that's just an example to illustrate how its done - there are usually decimals in scaled marks.