Please excuse the crudity of the drawing, but it represents a stylized fuel tank, with the dimensions (mm) in blue.
High School math will show that the volume of Z = 30,000 mm*3, Y = 48,000 mm*3, U = 18,000 mm*3, X = 9,000 mm*3 & V = 9,000 mm3. The total volume (Z+V+U+Y+X) is therefore = 114,000 mm*3.
- When the fuel float is at point A, the tank is 100% full and for the sake of my argument equals 19 litres of fuel.
- When it is at point B, the remain volume is (114,000-30,000)= 84,000 mm*3. This equates to 74% (84/114) or 14.1 litres.
- When the float is at point C, the remaining volume is (114-30-9-18-24)= 33,000mm*3. This equates to 29% (33/114) or 5.5 litres.
- When the float is at point D, the fuel tank is empty.
The ECU monitors the fuel float position as it moves along the path A-B-C-D and can easily perform the math to determine what the remaining fuel volume is, just as easily as I have in this example.
It knows the maximum volume of the tank (fixed) and it knows the position of the float (variable), the rest is simple math.
As for the "Range To Go", once the ECU knows the volume of fuel in the tank, and knows what rate it is injecting fuel into the engine, it is again simple math to calculate the estimated range.
For example, if I am traveling at 100 kph, and using 100 ml of fuel per minute and I have 10 litres of fuel in the tank, my estimated range is 167 kms. ((10,000/100)*100/60)