C digital to currency format
Publish: 2021-05-20 15:54:24
1. Bitcomputing power is a new business jointly established by 58coin exchange and miner manufacturers, mine pools and mine owners. Users can enjoy stable mining service by paying miner fees, electricity fees and management fees. Users can view it at any time in the background. The current business includes miner sales and custody, miner leasing and standard cloud computing power.
2. Hello
hold down the shift key and then press 4 keys
it's OK
there's nothing in word
it only represents personal opinions, don't spray if you don't like it, thank you.
hold down the shift key and then press 4 keys
it's OK
there's nothing in word
it only represents personal opinions, don't spray if you don't like it, thank you.
3. This is the summary of the knowledge point, hope to help you, a little more data< br />money_ format
(PHP 4 >= 4.3.0, PHP 5, PHP 7)
money_ Format - format a number into a currency string
description
money_ format ( string $format , float $number ) : string
money_ Format() returns the formatted version of number. This function wraps the strfmon () in the C function library. The difference is that this implementation can only convert one number at a time
parameter
format
the format string consists of the following parts:
single% character
optional flags
optional field width
optional, left precision
optional, right precision
required, single conversion character
flags
optional multiple tags, which are:
= f
character: =, It is followed by a character (single byte) f for number padding. The default padding character is space
^
disable grouping characters (such as comma in amount). Defined in the local locale
+ or (
format of positive and negative numbers). With +, the equivalent symbols of + and - in the locale will be used. If you use (), negative numbers are surrounded by parentheses. If it is not set, the default value is +< br />!
do not output currency symbols (such as & # 165;)
-
with this symbol, the fields will be left aligned (filled to the right). By default, the fields will be right aligned (filled to the left).
(PHP 4 >= 4.3.0, PHP 5, PHP 7)
money_ Format - format a number into a currency string
description
money_ format ( string $format , float $number ) : string
money_ Format() returns the formatted version of number. This function wraps the strfmon () in the C function library. The difference is that this implementation can only convert one number at a time
parameter
format
the format string consists of the following parts:
single% character
optional flags
optional field width
optional, left precision
optional, right precision
required, single conversion character
flags
optional multiple tags, which are:
= f
character: =, It is followed by a character (single byte) f for number padding. The default padding character is space
^
disable grouping characters (such as comma in amount). Defined in the local locale
+ or (
format of positive and negative numbers). With +, the equivalent symbols of + and - in the locale will be used. If you use (), negative numbers are surrounded by parentheses. If it is not set, the default value is +< br />!
do not output currency symbols (such as & # 165;)
-
with this symbol, the fields will be left aligned (filled to the right). By default, the fields will be right aligned (filled to the left).
4. int i = 60000;< br />string d=i.ToString(" c");
5. 打开VB编辑器,新建一模块,输入以下代码:
Public Function RMBDX(M)
RMBDX = Replace(Application.Text(Round(M + 0.00000001, 2), "[DBnum2]"), ".", "元")
RMBDX = IIf(Left(Right(RMBDX, 3), 1) = "元", Left(RMBDX, Len(RMBDX) - 1) & "角" & Right(RMBDX, 1) & "分", IIf(Left(Right(RMBDX, 2), 1) = "元", RMBDX & "角整", IIf(RMBDX = "零", "", RMBDX & "元整")))
RMBDX = Replace(Replace(Replace(Replace(RMBDX, "零元零角", ""), "零元", ""), "零角", "零"), "-", "负")
End Function
假如你要转换的数值在A1单元格,在B1或其他单元格输入= RMBDX(A1)
这是自定义函数,office 2003里面应该有带的
Public Function RMBDX(M)
RMBDX = Replace(Application.Text(Round(M + 0.00000001, 2), "[DBnum2]"), ".", "元")
RMBDX = IIf(Left(Right(RMBDX, 3), 1) = "元", Left(RMBDX, Len(RMBDX) - 1) & "角" & Right(RMBDX, 1) & "分", IIf(Left(Right(RMBDX, 2), 1) = "元", RMBDX & "角整", IIf(RMBDX = "零", "", RMBDX & "元整")))
RMBDX = Replace(Replace(Replace(Replace(RMBDX, "零元零角", ""), "零元", ""), "零角", "零"), "-", "负")
End Function
假如你要转换的数值在A1单元格,在B1或其他单元格输入= RMBDX(A1)
这是自定义函数,office 2003里面应该有带的
6. The following proceres are:
#include < stdio.h > < br/>#include < string.h> < br/>
#define N 100
int main(void)
{
char a[N]={0},b[N]={0};
br/> int len,cnt,i,j;< br/>
printf(" Invitation into a total of: ";< br/> scanf("% ", a);< br/ > b[0]= & #39;$ <39;< br/> len=strlen(a);< br/> cnt=len%3;< br/> for(i=0.j=1; i< len; i++)
{
if(cnt==0)
b[j+]= ' ' <39;< br/> =cnt=3;< br/> }
b[j++]=a[i];< br/> cnt--;< br/> }
printf(" Monetary format:%s & #92; n ", b); < br/>}
#include < stdio.h > < br/>#include < string.h> < br/>
#define N 100
int main(void)
{
char a[N]={0},b[N]={0};
br/> int len,cnt,i,j;< br/>
printf(" Invitation into a total of: ";< br/> scanf("% ", a);< br/ > b[0]= & #39;$ <39;< br/> len=strlen(a);< br/> cnt=len%3;< br/> for(i=0.j=1; i< len; i++)
{
if(cnt==0)
b[j+]= ' ' <39;< br/> =cnt=3;< br/> }
b[j++]=a[i];< br/> cnt--;< br/> }
printf(" Monetary format:%s & #92; n ", b); < br/>}
7.
main()
{
floatnum;
inti,mon,n[]={10000,5000,2000,1000,500,200,100,50,20,10,5,2,1},a[13];/*n数组是以分为单位的面值50元就是5000分*/
printf("请输入人民币数量");
scanf("%f",&num);
mon=(int)((0.0001+num)*100);/*将输入的浮点数转换为以分为单位的整数*/
printf("您输入的人民币为%f元 ");
printf("票面为");
for(i=0;i<13;i++)/*此循环是将张数算出来赋给a[]*/
{
if(mon/n[i])
{
a[i]=mon/n[i];
mon-=n[i]*a[i];
}
elsea[i]=0;
}
for(i=0;i<7;i++)/*输出*/
if(a[i])printf("%d元%d张 ",n[i]/100,a[i]);
for(;i<10;i++)
if(a[i])printf("%d角%d张 ",n[i]/10,a[i]);
for(;i<13;i++)
if(a[i])printf("%d分%d张 ",n[i],a[i]);
}
8. If it is a currency type, you can consider using enumeration
enum {
dollar,
Jan,
...
} currency;
enum {
dollar,
Jan,
...
} currency;
9. System.Convert.ToDouble("12354465").ToString("c")
10. It's also stipulated how many decimal places should be reserved for financial use.
if not, use long double
if not, use long double
Hot content