165
Views
15
Comments
Solved
How to convert currency to word in Outsystems platform
Application Type
Traditional Web

Please, kindly, help with an idea on how to convert currency value to words.

Example:

I want an idea on how to convert the value $1500 to one thousand, five hundred dollar only.

Please, help with an idea. Thanks

2023-01-19 12-23-07
Abhinav Shilwant
Solution

Hi Harrison,

Check this updated link as per your comment.
Check the below Screenshot which is exactly you wanted. 

Find the below attached OML for your reference.

I hope this will resolve your problem. Let me know.

Happy low coding :)

Best Regards,

Abhinav

NumberToText.oml
2022-08-13 08-15-57
Harrison
Solution

I finally figured out the problem with NumberToNaira oml.


The Solution to the Issue Reported above

I used the Round Function to reduce the number of decimal places to 2. This way, it worked as expected.

I placed the Round Function in the assign note value.


Thanks to Benjith Sam for his inputs.  

Special thanks goes to Abhinav Shilwant for his massive contribution.

2023-01-19 12-23-07
Abhinav Shilwant

Hi Harrison,

Did you checked these forge components which will convert a number value to its respective texts.

Forge 1

Forge 2

Forge 3

Forge 4

let me know if it works for you.

Best Regards,

Abhinav

2022-08-13 08-15-57
Harrison

Thanks for your response. 

The component above worked to some extent. 

But it did not spell the number correctly.

It did not do the correct spelling .

It spell $1,250,000.50  as twelve million five thousand and undefined five. See the screenshot below:


Example of what i want is:

$1,200.50 to be spelled out as, one thousand two hundred dollar and fifty cents.

Thanks

2022-08-13 08-15-57
Harrison
2023-01-19 12-23-07
Abhinav Shilwant

Hi Harrison,

Yes you are right "NumberToWords" forge component currently only supports numbers without decimal parts, but it is on their roadmap.
For your use case I would suggest you to use this component.

Warm Regards,

Abhinav

2022-08-13 08-15-57
Harrison

Hello Abhinav,

Thanks for your efforts. I deeply appreciate.

Little adjustment is required. Kindly help put the word "and" in the places the arrows are pointing to. Thanks again.

final screenshot.jpg
2023-01-19 12-23-07
Abhinav Shilwant
Solution

Hi Harrison,

Check this updated link as per your comment.
Check the below Screenshot which is exactly you wanted. 

Find the below attached OML for your reference.

I hope this will resolve your problem. Let me know.

Happy low coding :)

Best Regards,

Abhinav

NumberToText.oml
2022-08-13 08-15-57
Harrison


Hello Abhinav,

I have tried to replicate the NumberToText oml in my environment for days and still did not get it right. Could you kindly help adjust my OML file. It is attached here. Thanks please.

NumberToNaira.oml
2022-08-13 08-15-57
Harrison

Hello,

Please you kindly send  aol file of the numbertowords to me. Thanks in advance.

2022-08-13 08-15-57
Harrison

Hello,

How are you doing?

The solution you sent via web link worked perfectly. But the one i created did not work. Could you kindly send aol file so i can have a solution to my problem. As it stands, i dont have solution yet. Kindly send aol file here for me. Thanks

2021-03-18 21-03-15
Benjith Sam
 
MVP

Hi Harrison,

Below mentioned are the required code changes in your implementation to make it work.

1) Static Entity Language & Conversion 

  • Set Id attribute data type to Text
  • For each record, set the Id attribute text value
  • Below highlighted is only for Language, but similar code change is applicable for Conversion static entity as well.

2) I observed that in the Translate block, the InputValueId input parameter name is misleading - rename it to 'ResultExpressionId '

3) Set the Name property value to the result expression widget.

4) Pass the result expression id value to the Translate instance block as an input parameter

3) Change the input widget type to Number to restrict only number value as input

4) Remove the special list option value from all the dropdown widgets to avoid un-handled exceptions.

Demo screen: NumberToNaira_Fix

Refer to the attached oml with code fix.

I hope this helps you!


Kind regards,

Benjith Sam

NumberToNaira.oml
2022-08-13 08-15-57
Harrison

Hello Benjith Sam ,

Thanks for your efforts at assisting me.

I realized that it can not convert number to words if the number has more than two decimal place.

If the decimal place is more than two, it does not work. please kindly help fix it


For example: 250.12345050        


Kindly help me fix this issue thanks

2022-08-13 08-15-57
Harrison


Hello Abhinav,


Thanks for your efforts.

 

The NumberToWords has an issue. It is not working as expected.


The issue is that is stops working if the decimal place is more than two. 


Example: 250.15021426


If you input a number like in the example above, the NumberToNaira OML can not convert it to words


Please, kindly help me fix the problem.

2022-08-13 08-15-57
Harrison


Hello Benjith Sam,


Thanks for your efforts.

 

The NumberToNaira has an issue. It is not working as expected.


The issue is that is stops working if the decimal place is more than two. 


Example: 250.15021426


If you input a number like in the example above, the NumberToWords OML can not convert it to words


Please, kindly help me fix the problem.

UserImage.jpg
Sonali Verma

Hi,

@Harrison

Can you visit it .That is helpful for you.


Regards,
Sonali verma 


2022-08-13 08-15-57
Harrison
Solution

I finally figured out the problem with NumberToNaira oml.


The Solution to the Issue Reported above

I used the Round Function to reduce the number of decimal places to 2. This way, it worked as expected.

I placed the Round Function in the assign note value.


Thanks to Benjith Sam for his inputs.  

Special thanks goes to Abhinav Shilwant for his massive contribution.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.