Hi All,
Im trying to convert total amount of purchase order to text.
i have written the following code.
text_amount = fields.Char("Text Amount", size=100)
@api.onchange('amount_total') def _onchange_amount(self):
text_amount = amount_to_text_en.amount_to_text(math.floor(self.amount_total), lang='en', currency='Rupees') text_amount = text_amount.replace(' and Zero Cent', '') # Ugh
decimals = self.amount_total % 1 if decimals >= 10**-2:
text_amount += (' and %s/100 paise only') % int(round(float_round(decimals*100, precision_rounding=1))) self.text_amount = text_amount
Eg : Total =18,009.12
Text Amount - Eighteen Thousand, Nine Rupees and Zero Cent and 12/100 paise only
Iam getting this is the way..
I should get Eighteen Thousand, Nine Rupees and Zero Cent and 12 paise only
Please someone help me out with the issue.