| 320 | traditional=False, alt_zero=False, alt_one=False, alt_two=True, |
| 321 | use_zeros=True, use_units=True): |
| 322 | def get_value(value_string, use_zeros=True): |
| 323 | |
| 324 | striped_string = value_string.lstrip('0') |
| 325 | |
| 326 | # record nothing if all zeros |
| 327 | if not striped_string: |
| 328 | return [] |
| 329 | |
| 330 | # record one digits |
| 331 | elif len(striped_string) == 1: |
| 332 | if use_zeros and len(value_string) != len(striped_string): |
| 333 | return [system.digits[0], system.digits[int(striped_string)]] |
| 334 | else: |
| 335 | return [system.digits[int(striped_string)]] |
| 336 | |
| 337 | # recursively record multiple digits |
| 338 | else: |
| 339 | result_unit = next(u for u in reversed( |
| 340 | system.units) if u.power < len(striped_string)) |
| 341 | result_string = value_string[:-result_unit.power] |
| 342 | return get_value(result_string) + [result_unit] + get_value(striped_string[-result_unit.power:]) |
| 343 | |
| 344 | system = create_system(numbering_type) |
| 345 | |