将数值转换为单词? [英] convert numeric value to word?

查看:94
本文介绍了将数值转换为单词?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建一个将数值转换为单词的类?以及如何使用它?

How to create a class for convert numeric value to words? and how to use it?

推荐答案

见这里:将数字转换为等价的单词。 [ ^ ]


如果你想转换一个整数,无符号整数,双精度或任何将数据作为数值存储到字符串中的东西(那是包含单词的东西)那么:

首先声明一个字符串和一个整数/ double / uint或任何支持数值的东西,如下所示:

If you mean to convert an integer,unsigned integer, double, or anything that stores data as a numeric value to a string (that's what contains words) then :
First declare a string and a integer/double/uint or anything that supports numeric values, like this :
int a;



秒声明一个字符串:


Second declare a string :

string output;



这将有助于我们转换并存储转换后的数字。

声明另一个字符串在屏幕上打印数据:


This will help us convert and store the converted number.
Declare another string to print the data on the screen :

string print;



为他们分配价值,


Assign Values to them,

a = 1234;



现在这里是主要的代码:


Now here's the main code :

output = a.ConvertToString(); //Converts the integer to a string and assigns it to a store variable
output = print;
Console.WriteLine(print);//Prints the output variable on the screen
Console.ReadLine();



问题?在评论部分写下。

如果你认为你已经找到问题的解决方案,只需点击'绿色''接受解决方案'按钮。


Problems? Write that in the comment section.
If you think that you have got the solution to the problem just click on the 'Green' 'Accept Solution' button.


这篇关于将数值转换为单词?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆