in FW, there really isn't a measuring kit to give you a good reading of Ca or Mg, so I will assume that you mean how to tell what GH will be when dosing Ca and Mg products:
The general formula is:
Ca in ppm x 2.5* + Mg in ppm x 4.1 = actual GH ppm
*the x2.5 factor is only relevant if dosing any product other than CaCO3 (calcium carbonate). If dosing CaCO3, then you do not have to multiple by anything (i.e. x1).
I believe you can use this same math on a city water report if they list Ca and Mg in ppm there. They generally tell you if the Ca content is from CaCO3 or not.
450g Planted Discus Tank - Work in Process!