I want to convert transaction amount into words eg $345.67 to Three Hundred forty five point sixty seven in azure data factory.
How can we acheive this.
Use lambda function with number_to_words
from inflect
:
df = pd.DataFrame({'col': ['$345.67','$90.56', '$890']})
import inflect
p = inflect.engine()
df['new'] = df['col'].apply(lambda x: p.number_to_words(x, decimal="point"))
print (df)
col new
0 $345.67 three hundred and forty-five point six seven
1 $90.56 ninety point five six
2 $890 eight hundred and ninety