← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 587038] Re: Conversion of currency into words for French needs corrections.

 

** Changed in: openobject-server
   Importance: Undecided => Low

** Changed in: openobject-server
     Assignee: (unassigned) => OpenERP's Framework R&D (openerp-dev-framework)

-- 
Conversion of currency into words for French needs corrections.
https://bugs.launchpad.net/bugs/587038
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.

Status in OpenObject Server: Confirmed

Bug description:
The conversion of numbers between 71-79 and 91-99 into letters doesn't function correctly. Here is an example : 73 is written "soixante-dix-trois" instead of de "soixante-treize". And the number from 100-199 also written uncorrecty. Example 100 is written "un cent" instead of "cent".
Here are my modifications:
1.)
# convert a value < 100 to French.
def _convert_nn_fr(val):
    if val < 20:
        return to_19_fr[val]
    for (dcap, dval) in ((k, 20 + (10 * v)) for (v, k) in enumerate(tens_fr)):
        if dval + 10 > val:
            if val % 10:
		if val > 70 and val <= 79:
		    dcap = 'Soixante'
		    val1 = val % 20
		elif val > 90 and val <= 99:
		    dcap = 'Quatre-vingts'
		    val1 = val % 20
		else:
		    val1 = val % 10
                return dcap + '-' + to_19_fr[val1]
            return dcap

2.)
def _convert_nnn_fr(val):
    word = ''
    (mod, rem) = (val % 100, val // 100)
    if rem > 0:
        word = 'Cent'
	if rem > 1:
            word = to_19_fr[rem] + ' ' + word
        if mod > 0:
            word = word + ' '
    if mod > 0:
        word = word + _convert_nn_fr(mod)
    return word

Please make a diff between those two methods ans those from ./openerp-server/tools/amount_to_text.py.
I work with the server 5.0.7

Best Regars
red