VFP 愛用者社區 首頁 VFP 愛用者社區
本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.
 
 常見問題常見問題   搜尋搜尋   會員列表會員列表   會員群組會員群組   會員註冊會員註冊 
 個人資料個人資料   登入檢查您的私人訊息登入檢查您的私人訊息   登入登入

各高手 string format 問題

 
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區
上一篇主題 :: 下一篇主題  
發表人 內容
leokwok2001



註冊時間: 2011-02-10
文章: 13


第 1 樓

發表發表於: 星期四 二月 10, 2011 1:26 pm    文章主題: 各高手 string format 問題 引言回覆

有一個數值 -1234560.99 , 想變成string typ e.g. ($1,234,560.99) store in variable x , 請問vfp 怎麼寫?
回頂端
檢視會員個人資料 發送私人訊息
aizz



註冊時間: 2007-01-29
文章: 171


第 2 樓

發表發表於: 星期四 二月 10, 2011 2:09 pm    文章主題: Re: 各高手 string format 問題 引言回覆

leokwok2001 寫到:
有一個數值 -1234560.99 , 想變成string typ e.g. ($1,234,560.99) store in variable x , 請問vfp 怎麼寫?


不難
回頂端
檢視會員個人資料 發送私人訊息
leokwok2001



註冊時間: 2011-02-10
文章: 13


第 3 樓

發表發表於: 星期四 二月 10, 2011 2:13 pm    文章主題: 引言回覆

各高手請指點一下
回頂端
檢視會員個人資料 發送私人訊息
aizz



註冊時間: 2007-01-29
文章: 171


第 4 樓

發表發表於: 星期四 二月 10, 2011 2:15 pm    文章主題: 引言回覆

leokwok2001 寫到:
各高手請指點一下


老了
累了
退休了

躺在長灘島沙灘上享受陽光中.....

懶了.............
回頂端
檢視會員個人資料 發送私人訊息
garfield
Site Admin


註冊時間: 2003-01-30
文章: 2157


第 5 樓

發表發表於: 星期四 二月 10, 2011 5:23 pm    文章主題: 引言回覆

Using TRANSFORM( ) with a large negative number that contains a decimal might result in numeric overflow when that number is passed in as a memory variable. You should use the STR( ) function instead with such numbers.

TRANSFORM(eExpression, [cFormatCodes])

cFormatCodes
Specifies one or more format codes that determine how to format the expression.

@$
Adds the current currency symbol specified by SET CURRENCY to currency and numeric values. By default, the symbol is placed immediately before or after the value. However, the currency symbol and its placement (specified with SET CURRENCY), the separator character (specified with SET SEPARATOR) and the decimal character (specified with SET POINT) can all be changed.

.
Specifies the decimal point position in currency and numeric values.

,
Separates digits to the left of the decimal point in currency and numeric values.

9
Specifies width of numeric values.

For example, if cFormatCodes is '999.99', the numeric characters are formatted with three characters to the left of the decimal point, and two characters to the right.

_________________
利用>>搜尋<<的功能會比問的還要快得到答案.
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件
leokwok2001



註冊時間: 2011-02-10
文章: 13


第 6 樓

發表發表於: 星期四 二月 10, 2011 5:42 pm    文章主題: 引言回覆

thx
回頂端
檢視會員個人資料 發送私人訊息
從之前的文章開始顯示:   
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區 所有的時間均為 台北時間 (GMT + 8 小時)
1頁(共1頁)

 
前往:  
無法 在這個版面發表文章
無法 在這個版面回覆文章
無法 在這個版面編輯文章
無法 在這個版面刪除文章
無法 在這個版面進行投票
無法 在這個版面附加檔案
無法 在這個版面下載檔案


Powered by phpBB © 2001, 2005 phpBB Group
正體中文語系由 phpbb-tw 維護製作