It's doing some text parsing on the "pretty text" returned by the Google Maps API instead of using the provided distance in meters, and it's probably failing due to some localisation issue. It strips "," from the text, maybe your locale uses "," as a decimal separator leading to the distance being parsed as 24 km?