Internationalization and localization tools


Locale-Sensitive Python Method

float(string or number)

Internationalization (I18n) Method Overview

The float constructor takes a number in string format.

Click here for more information.

I18n Issues

The float constructor is not locale-aware so will assume decimal separator is a period.

Suggested Replacement

To ensure that the current culture is used when parsing the string to create the float, call locale.atof.

Globalyzer will detect this method and report it as an I18n issue. If you have determined that the call is being handled correctly, you can use Globalyzer's Ignore Comment functionality to ensure that it isn't picked up in a subsequent scan.

Locale-Sensitive Python Methods

Lingoport internationalization and localization services and software