全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1982
推到 Plurk!
推到 Facebook!

請問dbedit 金額欄位,顯示為何都有小數.

缺席
chris681016
中階會員


發表:69
回覆:122
積分:98
註冊:2006-10-12

發送簡訊給我
#1 引用回覆 回覆 發表時間:2013-10-24 14:32:22 IP:211.75.xxx.xxx 訂閱
  DBEdit3.DataField:='pmoney';
//-----------sql是金額欄位money
TCurrencyField(fdm.Single_cds.FieldByName('pmoney')).EditFormat:='#########';
TCurrencyField(fdm.Single_cds.FieldByName('pmoney')).DisplayFormat:='###,###,###';
例 DBEdit3=3000 顯示會變成 3,000. 修改 3000.
為何會有那個小數點呢,可以去掉嗎?
tuga
高階會員


發表:16
回覆:109
積分:120
註冊:2002-07-13

發送簡訊給我
#2 引用回覆 回覆 發表時間:2013-10-24 17:17:20 IP:1.34.xxx.xxx 訂閱
Thousand separator. If the format string contains one or more "," characters,  the output will have thousand separators inserted between each group of three  digits to the left of the decimal point. The placement and number of ","  characters in the format string does not affect the output, except to indicate  that thousand separators are wanted. The actual character used as the thousand  separator in the output is determined by the ThousandSeparator global variable.  The default value of ThousandSeparator is specified in the Number Format of the  Regional Settings section of the Windows Control Panel. 

逗號是千位數的分隔符號
P.D.
版主


發表:603
回覆:4038
積分:3874
註冊:2006-10-31

發送簡訊給我
#3 引用回覆 回覆 發表時間:2013-10-27 21:12:19 IP:118.169.xxx.xxx 未訂閱
你自己所寫的 EDITFORMAT 及 DISPLAYFORMAT 就不同了嘛
===================引 用 chris681016 文 章===================
DBEdit3.DataField:='pmoney';
//-----------sql是金額欄位money
TCurrencyField(fdm.Single_cds.FieldByName('pmoney')).EditFormat:='#########';
TCurrencyField(fdm.Single_cds.FieldByName('pmoney')).DisplayFormat:='###,###,###';
例 DBEdit3=3000 顯示會變成 3,000. 修改 3000.
為何會有那個小數點呢,可以去掉嗎?
way888
初階會員


發表:32
回覆:76
積分:36
註冊:2005-05-31

發送簡訊給我
#4 引用回覆 回覆 發表時間:2013-11-17 22:07:12 IP:114.25.xxx.xxx 訂閱
試試'#,###,##0.'
我都是這樣用,沒有你說的問題
系統時間:2024-04-20 2:49:34
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!