社区
C++ Builder
帖子详情
财务上的数字小写转大写,有没有现成的东西可以用的?
mygodness
2003-08-24 11:07:20
以前我自己写过一个类,弄丢了,网上有现成的吗?
...全文
513
6
打赏
收藏
财务上的数字小写转大写,有没有现成的东西可以用的?
以前我自己写过一个类,弄丢了,网上有现成的吗?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
Nicesoft
2003-10-24
打赏
举报
回复
QLDBGrid Suite
特性
中国财务凭证式的金额显示。各显示位之间的分隔线颜色可自行定义,并可在标题行上显示“...万千百十个角分”!!!
支持多种方式的合计行。支持合计、平均、计数、文本等方式的合计行。中国财务凭证式的金额显示在合计行上同样适用。合计行的颜色可自行定义!!!
可在 Grid 的各列上嵌入任意控件来代替默认编辑器,例如可在布尔型字段的列上嵌入 DBCheckBox,在一只读或计算字段的列上嵌入 DBEdit!!!
支持交替式的行颜色显示。奇数行和偶数行可定义不同的颜色
自适应宽度。Grid 中的各列的宽度随 Grid 宽度的改变可自行调整宽度,使其始终填充整个 Grid 客户区域
回车键转换为制表键。可将回车键当作制表键来处理,使用户敲回车键时自动转入下一列或行,输入数据更快速方便
结合 TQLQRDBGridBuilder 自动生成 QuickReport 报表,省去手工制作报表的麻烦!!!
结合 TQLDBLookupComboBox 实现输入内容按拼音码查找(如同速达 E2 中的品名输入方式),而不必在大量的产品目录中来回查找或强迫用户记忆大量的产品代码!!!
继承自标准的 TDBGrid,使用 TDBGrid 或其子类开发的现有程序可实现平滑升级
更多强大的特性....
下载地址:
http://developer.nicesoft.net
http://www.nicesoft.net/downloads/qll.rar
mygodness
2003-08-24
打赏
举报
回复
谢谢了,我先看看,如果没有错,一定给你加分..呵呵
jingrunx
2003-08-24
打赏
举报
回复
//---------------------------------------------------------------------------
#pragma hdrstop
#include <stdio.h>
#include <windows.h>
#include <winnls.h>
#include "ChineseCurrency.h"
//---------------------------------------------------------------------------
CChineseCurrency::CChineseCurrency(void)
: fCurrency(0.0f), enumCase(ccLowerCase)
{
SetCurrency();
}
//---------------------------------------------------------------------------
CChineseCurrency::CChineseCurrency(double value)
: fCurrency(value), enumCase(ccLowerCase)
{
SetCurrency();
}
//---------------------------------------------------------------------------
CChineseCurrency::CChineseCurrency(CurrencyCase cc)
: fCurrency(0.0f), enumCase(cc)
{
SetCurrency();
}
//---------------------------------------------------------------------------
CChineseCurrency::CChineseCurrency(double value, CurrencyCase cc)
: fCurrency(value), enumCase(cc)
{
SetCurrency();
}
//---------------------------------------------------------------------------
void CChineseCurrency::SetCurrency(void)
{
char stmp[20], *p;
if(fCurrency < fMin) throw underflow_error("underflow_error");
if(fCurrency > fMax) throw overflow_error("overflow_error");
sprintf(stmp, "%19.2f", fCurrency);
bool t1/*0变为?*/, t2/*当前为0*/, t3/*上一位为0*/;
for(int i=0; i<4; i++) {
t1 = false;
t3 = false;
for(int j=3; j>=0; j--) {
p = stmp + (i*4 + j);
t3 = t2;
t2 = (*p == '0');
if(!t1) {
t1 = !t2;
}
if(!t1) {
*p = ' ';
}
if(t2 && t3) {
*p = ' ';
}
}
}
wchar_t *ws = wsChineseCurrency, *wsp;
(*ws++) = wcPrefix;
if(fCurrency < 1.0f) goto decimal;
for(int i=0; i<4; i++) {
wsp = ws;
for(int j=0; j<4; j++) {
p = stmp + (i*4 + j);
if(*p != ' ') {
(*ws++) = wcNumber[enumCase][*p - '0'];
if(*p!='0' && j<3) {
(*ws++) = wcInnerSplit[enumCase][j];
}
}
}
if(wsp!=ws || i==3) {
(*ws++) = wcSplit[enumCase][i];
}
}
decimal:
if(fCurrency == 0.0f) { //0元
(*ws++) = wcNumber[enumCase][0];
(*ws++) = wcSplit[enumCase][3];
}
if(stmp[17]=='0' && stmp[18]=='0') { //没有小数
(*ws++) = wcInnerSplit[enumCase][5];
} else { //xx角xx分
(*ws++) = wcNumber[enumCase][stmp[17] - '0'];
(*ws++) = wcInnerSplit[enumCase][3];
(*ws++) = wcNumber[enumCase][stmp[18] - '0'];
(*ws++) = wcInnerSplit[enumCase][4];
}
(*ws++) = L'\0';
}
//---------------------------------------------------------------------------
CChineseCurrency& CChineseCurrency::operator = (double value)
{
fCurrency = value;
SetCurrency();
return *this;
}
//---------------------------------------------------------------------------
CChineseCurrency::operator const char* (void) const
{
UINT cchMultiByte = 0;
static char stmp[80];
cchMultiByte = ::WideCharToMultiByte(CP_ACP, 0,
wsChineseCurrency, wcslen(wsChineseCurrency),
stmp, sizeof(stmp),
NULL, NULL
);
stmp[cchMultiByte] = '\0';
return stmp;
}
//---------------------------------------------------------------------------
CChineseCurrency::operator const wchar_t* (void) const
{
return wsChineseCurrency;
}
//---------------------------------------------------------------------------
ostream& operator << (ostream& os, const CChineseCurrency& arg)
{
return os << (const char*)arg;
}
//---------------------------------------------------------------------------
istream& operator >> (istream& is, CChineseCurrency& arg)
{
double value = 0.0f;
is >> value;
arg = value;
return is;
}
//---------------------------------------------------------------------------
wostream& operator << (wostream& os, const CChineseCurrency& arg)
{
return os << (const wchar_t*)arg;
}
//---------------------------------------------------------------------------
wistream& operator >> (wistream& is, CChineseCurrency& arg)
{
double value = 0.0f;
is >> value;
arg = value;
return is;
}
//---------------------------------------------------------------------------
#pragma package(smart_init)
jingrunx
2003-08-24
打赏
举报
回复
//---------------------------------------------------------------------------
#ifndef ChineseCurrencyH
#define ChineseCurrencyH
#include <string>
#include <iostream>
using namespace std;
//---------------------------------------------------------------------------
enum CurrencyCase { ccLowerCase, ccUpperCase };
class CChineseCurrency {
static double fMin, fMax;
static wchar_t wcPrefix;
static wchar_t wcInnerSplit[2][6];
static wchar_t wcSplit[2][4];
static wchar_t wcNumber[2][10];
private:
CurrencyCase enumCase;
double fCurrency;
wchar_t wsChineseCurrency[40];
protected:
void SetCurrency(void);
public:
CChineseCurrency(void);
CChineseCurrency(double value);
CChineseCurrency(CurrencyCase cc);
CChineseCurrency(double value, CurrencyCase cc);
CChineseCurrency& operator = (double value);
operator const char* (void) const;
inline operator const wchar_t* (void) const;
};
double CChineseCurrency::fMin = 0.00f;
double CChineseCurrency::fMax = 9999999999999999.99f;
wchar_t CChineseCurrency::wcPrefix = L'币';
wchar_t CChineseCurrency::wcInnerSplit[2][6] = {
{L'千', L'百', L'十', L'角', L'分', L'正'},
{L'仟', L'佰', L'拾', L'角', L'分', L'整'}
};
wchar_t CChineseCurrency::wcSplit[2][4] = {
{L'兆', L'亿', L'万', L'元'},
{L'兆', L'亿', L'万', L'圆'}
};
wchar_t CChineseCurrency::wcNumber[2][10] = {
{L'零', L'一', L'二', L'三', L'四', L'五', L'六', L'七', L'八', L'九'},
{L'零', L'壹', L'贰', L'叁', L'肆', L'伍', L'陆', L'柒', L'捌', L'玖'}
};
ostream& operator << (ostream& os, const CChineseCurrency& arg);
istream& operator >> (istream& is, CChineseCurrency& arg);
wostream& operator << (wostream& os, const CChineseCurrency& arg);
wistream& operator >> (wistream& is, CChineseCurrency& arg);
//---------------------------------------------------------------------------
#endif
mygodness
2003-08-24
打赏
举报
回复
现在怎么好像人气比以前差一些了,没有人知道吗?
asimpleman
2003-08-24
打赏
举报
回复
GZ
易速快递单打印软件 v1.55.zip
易速快递单打印软件官方版是一款简单好用的快递单打印软件,即有申通、中通、圆通等
现成
的快递单模板供您选择,您也可以根据自己手中的快递单自己动手设计模板并进行保存,格式底图可以更换成您手中的快递单图片。...
python音频处理用到的操作的示例代码
其实网上有很多
现成
的音频工具包,如果仅仅调用,工具包是更方便的。 更多pyton下的操作可以参考: 用python做科学计算 1、批量读取.wav文件名: 这里用到字符串路径: 1.通常意义字符串(str) 2.原始字符串,以
大写
R...
java中把一个字符串中
大写
字母
转
换为
小写
,
小写
字母
转
换为
大写
java中把一个字符串中
大写
字母
转
换为
小写
,
小写
字母
转
换为
大写
观看提示: 这里提供2中思维,但是第一种是正确的,第二种是错误的;第二种的思维可以了解了解,但是需要注意的是如果某个字符串定义为String类型,...
C#实现
小写
金额
转
大写
金额
最近项目上用到
小写
转
大写
金额,公司同事还准备写一段代码来实现,后来发现架构上有
现成
的。 其实在银行、进销存、CRM等系统中经常可能用到 这个跟大家分享一下:
小写
金额
转
大写
///<summary>/...
c语言一串
大写
字母
转
小写
,C语言的基础函数大
小写
转
换
在程序中经常会需要对字母的大
小写
进行
转
换,虽然有
现成
的upper/lower函数,但是有时因为各种原因,或想减小程序的体积,需要自己编写函数来实现。这里来讨论一下各种
转
换的方法。根据ASCII码我们可以知道
大写
字母和...
C++ Builder
13,825
社区成员
102,679
社区内容
发帖
与我相关
我的任务
C++ Builder
C++ Builder相关内容讨论区
复制链接
扫一扫
分享
社区描述
C++ Builder相关内容讨论区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章