File: utils.py

package info (click to toggle)
ofxstatement-plugins 20161204
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,160 kB
  • ctags: 1,619
  • sloc: python: 4,374; xml: 292; makefile: 103
file content (15 lines) | stat: -rw-r--r-- 500 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env python3
# This file is part of ofxstatement-austrian.
# See README.rst for more information.


def clean_multiple_whitespaces(uncleaned_string):
    """Clean a string from multiple consecutive white spaces."""
    return ' '.join(uncleaned_string.split())


def fix_amount_string(amount):
    """Replace »,« with ».« to make the amount parseable."""
    return amount.replace('.', '').replace(',', '.')

# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 smartindent autoindent