sql中将月份转化为数字
If you ever need to convert number to words in Excel, there's a sample file on my Contextures site, to help you do that. Ron Coderre created the workbook, and he just updated it.
如果您需要在Excel中将数字转换为单词,我的Contextures网站上有一个示例文件,可以帮助您实现这一目标。 Ron Coderre创建了工作簿,他刚刚对其进行了更新。
将数字转换为单词 (Convert Number to Words)
Ron created two versions of the workbook - one with macros, and another file that uses formulas and named ranges to convert number to words (no macros).
罗恩创建了工作簿的两个版本-一个带有宏,另一个使用公式和命名范围将数字转换成单词的文件(没有宏)。
Recently, Ron updated the macro version, to fix some international issues that a user reported recently.
最近,Ron更新了该宏版本,以修复用户最近报告的一些国际问题。
The file uses a User Defined Function (UDF) to change a number into written words, with options to specify a major currency, such as dollars and a minor currency, such as cents.
该文件使用用户定义函数(UDF)将数字更改为书面文字,并提供选项以指定主要货币(例如美元)和次要货币(例如美分)。
NumsToWords UDF (NumsToWords UDF)
The UDF that Ron created is named NumsToWords, and you can see how it will convert a number to words, in the screen shot below.
Ron创建的UDF名为NumsToWords,您可以在下面的屏幕快照中看到如何将数字转换为单词。
- A decimal number - 56.12 - was typed in cell C2. 在单元格C2中键入了十进制数字-56.12。
-
=NumsToWords(C2)
= NumsToWords(C2)
- The result is words: Fifty Six Dollars and Twelve Cents 结果就是单词:五十六美元和十二美分
NumsToWords必需参数 (NumsToWords Required Argument)
To use the NumsToWords function, you must enter the first argument - NumSource. That's the source to convert a number to words.
要使用NumsToWords函数,必须输入第一个参数-NumSource。 这就是将数字转换为单词的来源。
Use a cell reference: =NumsToWords(C2)
使用单元格引用: = NumsToWords(C2)
Or, type a number:=NumsToWords(56.12)
或者,键入数字: = NumsToWords(56.12)
NumsToWords可选参数 (NumsToWords Optional Arguments)
The NumsToWords function also has 4 optional arguments. If you omit an optional argument, its default value is used:
NumsToWords函数还具有4个可选参数。 如果省略可选参数,则使用其默认值:
MajorCurrency: Primary currency name (Default is "Dollar")
MajorCurrency :主要货币名称(默认为“美元”)
MinorCurrency: Secondary currency name (Default is "Cent")
MinorCurrency :次要货币名称(默认为“美分”)
MajorMinorLink: Word connecting MajorCurrency and MinorCurrency (Default is "and")
MajorMinorLink :连接MajorCurrency和MinorCurrency的单词(默认为“和”)
SkipMinor: True/False flag to ignore the MinorCurrency (Default is FALSE)
SkipMinor :True / False标志忽略MinorCurrency(默认为FALSE)
NumToWords示例 (NumToWords Examples)
Here are a few examples of using the optional arguments with the NumToWords UDF. There are more examples in the workbook, that show how to convert number to words with this UDF.
以下是将可选参数与NumToWords UDF一起使用的一些示例。 工作簿中还有更多示例,展示了如何使用此UDF将数字转换为单词。
Instead of the default Dollars and Cents, you can enter different text for the first two arguments - MajorCurrency (Goat) and MinorCurrency (Kid):
您可以为前两个参数输入不同的文本,而不是默认的美元和美分-MajorCurrency(Goat)和MinorCurrency(Kid):
=NumsToWords(C2,"Goat","Kid")
= NumsToWords(C2,“山羊”,“孩子”)
Here's the result: Fifty Six Goats and Twelve Kids
结果是: 五十六只山羊和十二个孩子
Instead of showing "and" between the major and minor currencies, use an empty string as the 3rd argument, MajorMinorLink.
不要在主要货币和次要货币之间显示“和”,而应使用一个空字符串作为第三个参数MajorMinorLink。
=NumsToWords(C2,,,"")
= NumsToWords(C2 ,,“”“)
Here's the result: Fifty Six Dollars Twelve Cents
结果是: 56美元十二美分
For MajorCurrency, use an empty string, change MinorCurrency (Knot), and the MajorMinorLink text (Point).
对于MajorCurrency,使用一个空字符串,更改MinorCurrency(结),然后更改MajorMinorLink文本(点)。
=NumsToWords(C2,"","Knot","Point")
= NumsToWords(C2,“”,“ Knot”,“ Point”)
Here's the result: Fifty Six Dollars Twelve Cents
结果是: 56美元十二美分
将数字转换为文件中的单词 (Convert Numbers to Words in Your File)
In Ron's workbook, there is a button that will automatically export the NumToWords function into any open workbook.
在Ron的工作簿中,有一个按钮会自动将NumToWords函数导出到任何打开的工作簿中。
You don't have to know how to use VBA – just click the button, and the work is done for you! You don't need any programming skills to get started.
您不必知道如何使用VBA,只需单击按钮,即可为您完成工作! 您不需要任何编程技能即可上手。
将数字转换为单词样本文件 (Convert Number to Words Sample File)
To get Ron's Number to Words sample files, go to his page on my Contextures website. In the Excel Functions section, look for RF0001- Convert Numbers to Words, and download either the VBA version or the non-VBA version -- or both!
要获取Ron的“单词转换为数字”示例文件,请访问Contextures网站上的 Ron 页面 。 在“ Excel函数”部分中,查找RF0001-将数字转换为单词 ,然后下载VBA版本或非VBA版本-或两者!
NOTE: If you need to do the opposite, get Jerry Latham's sample file to convert words to numbers in Excel.
注意:如果需要执行相反操作,请获取Jerry Latham的示例文件,以在Excel中将单词转换为数字 。
翻译自: https://contexturesblog.com/archives/2009/03/24/convert-number-to-words-in-excel/
sql中将月份转化为数字