当前位置:首页 » 编程博文
开发技术指南» 文章正文
    引言: using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data; namespace WinM...
 

 

 ·c#中结构与类的区别    »显示摘要«
    摘要: 目录 类与结构的实例比较 类与结构的差别 如何选择结构还是类 一.类与结构的示例比较: 结构示例: public struct person { string name; int height; int weight public bool overweight() { //implement something } } 类示例: pu......
 ·linker tools warning lnk4098    »显示摘要«
    摘要:linker tools warning lnk4098 defaultlib "library" conflicts with use of other libs; use /nodefaultlib:library you are trying to link with incompatible libraries. important the run-time li......


数值型货币的大写转换

using system;

using system.drawing; 【程序编程相关:Java程序员的存储过程

【推荐阅读:网络故障维护

using system.collections; 【扩展信息:C++Builder读取鼠标屏幕位置

using system.componentmodel;

using system.windows.forms;

using system.data;

namespace winmarket

{

 /// <summary>

 /// classfun 的摘要说明.

 /// </summary>

 public class classfun

 {

  private string capstr;

 

  public classfun()

  {

   //

   // todo: 在此处添加构造函数逻辑

   //

  }

  public string moneynumtocap(decimal num)

  {

   string cap="零壹贰叁肆伍陆柒捌玖";

   string numstr="0123456789";

      string moneynumstr=num.tostring();

   int pint=moneynumstr.indexof(".");

            int numint;

            string moneyint=null;

   string moneydec=null;

   string intstr=null;

   string moneycap=null;

   string moneyintstr=null;

   string moneydecstr=null;

//   capstr=pint.tostring();

 

   if(pint!=-1)

   {

    string strarr=".";

    char[] chararr=strarr.tochararray();


...   下一页
    摘要:刚才看到一个兄弟提的问题,做完了才发现已经结贴,郁闷呀~~只是看到这个东西还算有用,所以贴出来自赏呵呵思路:一开始想到用select,用for循环将每位阿拉伯数字转换成对应的中文,然后想到其实可以用数组,这样子比较少些代码,毕竟0~9,可以对应起来,可是~问题出现了,对于10~31,要变成“贰拾壹” 这样格式,呵呵~加一个判断,嗯~11可不能转换成“壹拾壹......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE