How can I convert an integer into its verbal representation?

后端 未结 14 2271
走了就别回头了
走了就别回头了 2020-11-22 15:23

Is there a library or a class/function that I can use to convert an integer to it\'s verbal representation?

Example input:

4,567,788`

14条回答
  •  一整个雨季
    2020-11-22 16:02

    I was tasked to create a WEB API that converts numbers to words using C#.

    Can be whole number or with decimal points in 48 hours time.

    The call will be coming from a front-end application using Ajax Post method and return the converted result in the webpage.

    I've publicly shared that project in the GitHub for reference: https://github.com/marvinglennlacuna/NumbersToWordsConverter.Api

    With the following technical implementatation in placed:

    1. MVC structured
    2. API Controller
    3. Service
    4. Model
    5. Error Handling
    6. Unit Testing using MSTest
    7. Code Coverage - 98%
    8. Jquery

    And with technical documentation about the following as well:

    1. Purpose
    2. Prerequisites
    3. Functionl Requirements
    4. Process Diagram and Output

    **Result via Web Page (US-001) **

    US-001 Convert Numbers to Words via web page process

    US-001 Convert Numbers to Words via web page output

    Result via Postman (US-002)

    US-002 - Convert Numbers to Words via Postman process

    US-002 - Convert Numbers to Words via Postman output

    I think it's just worth sharing a working solution in the case you need it for reference in interview/code test/school or for fun only.

    Cheers, Marvin

提交回复
热议问题