English Summary: This article describe about how to use String.Format to implement the same with sprintf or printf in C++. For English, Please refer this article for more detail. 中文: 最近遇到一些好玩的現象~~ 再次就把解決方式寫下來吧~~ (這篇就不用寫英文了,要看英文的部份請看這篇文章)。 最近在C#上面,想要輸出固定2個位元小數點浮點數~ 為了這件事情~~ 覺得有點難搞~~ 由於傳下來的數字是Double 來儲存的,並且有可能是循環小數 (比如說: 10/3 = 3.333)。 如果~~ 你單純的使用Math.Round() 比如以下的範例: Double buf = 3.33333333333333333; buf = Math.Round(buf , 2); > > 這個時候~ 你還是會發現 buf 還是那一連串的小數點~ 而沒有再小數點第二位去取四捨五入。原因在於小數點數字過多~ 而產生了 exception 的發生。 這個時候我又想了一個方法,參考以下的code: Double buf = 3.33333333333333333; buf = Math.Abs(buf*100); buf = bug/100; > > 很奇怪的~~ 這樣也是無法轉換到兩個小數點~ 還會變成原來的數字~~ (難道是最佳化?) 難道我得使用CallingConvention Enumeration 的方式,把sprintf 當作外在function call嗎? Imports System Imports Microsoft.VisualBasic Imports System.Runtime.InteropServices Public Class LibWrap ' Visual Basic does not support varargs, so all arguments must be ' explicitly defined. CallingConvention.Cdecl must be used since the stack ' is cleaned up by the caller. ' int printf( const char *format [, argument]... ) <DllImport("msvcrt.dll", CallingConvention := CallingConvention.Cdecl)> _ Overloads Shared Function printf ( _ format As String, i As Integer, d As Double) As Integer End...
好久沒把這塊遊戲再度拿出來玩~~~ 會把NBA Live 07拿出來玩的主因~~ 就是由於我的電腦中毒了 所以的遊戲都不見了~ 重新去安裝軟體的時候~ 翻了翻手邊遊戲之中 忽然又看到這塊讓我又愛又恨的遊戲~
由於07電腦換人與自幹的問題(改過PATCH 與 ROSTER之後仍然嚴重)~~ 我之前就先在網路上找NBA Live 06的最新球員更新檔~~
但是苦於找不到的情況下~ 先找到了這個更新檔~~ 不過在安裝Jimmy GameFix 系列之前~ 還是要先安裝 Live 2007 中文版更新檔 。之後再去這裡下載Jimmy GameFix 9.7 (雖然圖片是9.4~ 但是最新版本已經到達了9.7)
In 9.7 improvements from the previous version:
1. AI improvement
2. Re-new Team strategy for Defense
3. Re-new Team strategy for Offense
4. Different of Alleyoops
5. Dunking for Star Highflyers[credit to A_nuke]
6. Dynamic plays
7. More distribution of ball
8. Every players have chances to be more offensive
9. Some others improvement
10. Special edited AIACT
11. ONLY 100% work with IRPT roster 4.4 and 9x% work with IRPT roster 4.x
>
>
安裝方法~~ 裡面有兩個安裝檔~~ 就把他裝起來~~
安裝part1.exe
安裝part2.EXE
Copy For Dynasty Season or PlayoffSettings,dat 換掉原來安裝的 (這是調整Slider)
Copy TEAMPLAYFIX FOR NOinjury ROSTER(compatible with all types of saves) 到你的王朝紀錄檔下~ 執行該BAT 可以幫你降低一些素質.
此外~~要 NBA Live 06 的最新球員更新檔??到這裡去找吧~~~