On this page
  1. locale.atof
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

locale.atof

Up: locale | Next: locale.atoi
Rel: locale.atoi, locale.currency, locale.Error, locale.format_string
Ref: docs.python.org — locale.atof
Tags: #public #python3 #stdlib #locale


Import

import locale
from locale import atof

Signature & Overview

locale.atof(string, func=<class 'float'>)

Parses a string as a float according to the locale settings.

Usage

import locale

assert locale.atof("12.5") == 12.5

Gotchas

REPL Inspect

from locale import atof
help(atof)

Linked from

Related notes