You have to introduce one more parameter (if there is no such in PID code already), that is a loop Gain (float). So that
(uint16) PWM duty = (uint16) ( (float) Gain x (float) PID_output)
Technically, the PI loop needs only 3 parameters (P, I and D), https://en.wikipedia.org/wiki/PID_controller
This is called a Parallel form.
but sometimes it is more natural to move out the overall gain outside the equation: gain (Kp), decrement (1/Ti) and delay (Td). This is called a Standard Form.
--> Just to make sure I understand your point, an example:
Kp = 1.1f
Ki = 2.2f (NOT my real PI gain numbers - just an example)
Fsample = 50kHz
Tsample = 20usec
...the next time sample from an equilibrium point [Ierror was 0 before this instant]:
Iref = 1.0A
Iactual = 0.8A
--> Ierror = 0.2A
Iprop_out = 0.2 * 1.1
Iint_out = Iint_out + (0.2 * 2.2 * Tsample)
PID_output = Gain * (Iprop_out + Iint_out)
Where now I have to decide a valid number for "Gain"
--> Do I understand correctly?
Please check PID material from this thread
I recommend starting with Bret Beauregard's Arduino PID library explanation (#2)
For example, the Gain scaling is discussed in Part 2 of the #1