This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//綠色的Style | |
NPOI.SS.UserModel.IFont fontG = workbook.CreateFont(); | |
fontG.Color = NPOI.SS.UserModel.IndexedColors.Green.Index; | |
var styleG = workbook.CreateCellStyle(); | |
styleG.SetFont(fontG); | |
//紅色的Style | |
NPOI.SS.UserModel.IFont fontR = workbook.CreateFont(); | |
fontR.Color = NPOI.SS.UserModel.IndexedColors.Red.Index; | |
var styleR = workbook.CreateCellStyle(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var i = 1; i <= 20; i++) | |
{ | |
sheetReportResult.CreateRow(i).CreateCell(0).SetCellValue("用戶" + i); | |
if (i== 5) | |
{ | |
var cell = sheetReportResult.GetRow(i).CreateCell(1); | |
cell.CellStyle = styleR; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var workbook = new HSSFWorkbook(); | |
var sheetReportResult = workbook.CreateSheet("報表結果"); | |
//綠色的Style | |
NPOI.SS.UserModel.IFont fontG = workbook.CreateFont(); | |
fontG.Color = NPOI.SS.UserModel.IndexedColors.Green.Index; | |
var styleG = workbook.CreateCellStyle(); | |
styleG.SetFont(fontG); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
decimal t1 = 123456.12345M; | |
decimal t2 = 123456.12345M; | |
decimal t3 = 12345678901234.123456789M; | |
Console.WriteLine(t1.ToString("#,###,###.###")); | |
//123,456.123 | |
Console.WriteLine(t2.ToString("#,###,###.####")); | |
//123,456.1235 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string GetMoneyString(decimal number) | |
{ | |
if (number.ToString().Contains(".")) | |
{ | |
var format = "#,###,###,####."; | |
var tmpDot = number.ToString().Split('.')[1]; | |
for (var i = 0; i < tmpDot.Length; i++) { | |
format += "#"; | |
} | |
return number.ToString(format); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Console.WriteLine("2021-01-01"); | |
Console.WriteLine("CalendarWeekRule.FirstDay :" + new GregorianCalendar().GetWeekOfYear(new DateTime(2021, 01, 01), CalendarWeekRule.FirstDay, DayOfWeek.Monday)); | |
Console.WriteLine(("CalendarWeekRule.FirstFourDayWeek :" + new GregorianCalendar().GetWeekOfYear(new DateTime(2021, 01, 01), CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday))); | |
Console.WriteLine(("CalendarWeekRule.FirstFullWeek :" + new GregorianCalendar().GetWeekOfYear(new DateTime(2021, 01, 01), CalendarWeekRule.FirstFullWeek, DayOfWeek.Monday))); | |
//Result | |
//2021-01-01 | |
//CalendarWeekRule.FirstDay :1 | |
//CalendarWeekRule.FirstFourDayWeek :53 | |
//CalendarWeekRule.FirstFullWeek :52 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var service = new EtherscanParse.TrasactionAgent(YOUR_TOKEN); | |
var info = service.GetTrasactionInfo(TXID); | |
Console.WriteLine("Gas Limit:" + Convert.ToInt32(info.result.gas, 16).ToString()); | |
Console.WriteLine("Gas Price:" + ((decimal)Int64.Parse(info.result.gasPrice.Replace("0x", ""), NumberStyles.AllowHexSpecifier) / 1000000000000000000).ToString("")); | |
Console.WriteLine("From:"+info.result.from); | |
Console.WriteLine("To:" + info.result.to); | |
Console.WriteLine("hash(TXID):" + info.result.hash); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var brInfo= service.GetBlockrewardWalletInfo(Convert.ToInt32(info.result.blockNumber, 16).ToString(), TEST_WALLET_ADDRESS); | |
Console.WriteLine("\r\n Wallet Data : \r\n"); | |
Console.WriteLine("\r\n-----------------------------------------"); | |
foreach (var wt in brInfo.result) { | |
Console.WriteLine("Source :"+JsonConvert.SerializeObject(wt)); | |
Console.WriteLine(""); | |
Console.WriteLine("TimeStamp:"+ ConvertTimestampToDateTime(double.Parse(wt.timeStamp)).ToString("yyyy-MM-dd HH:mm:ss")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var brInfo= service.GetBlockrewardWalletInfo(Convert.ToInt32(info.result.blockNumber, 16).ToString(), TEST_WALLET_ADDRESS); | |
Console.WriteLine("\r\n Wallet Data : \r\n"); | |
Console.WriteLine("\r\n-----------------------------------------"); | |
foreach (var wt in brInfo.result) { | |
Console.WriteLine("Source :"+JsonConvert.SerializeObject(wt)); | |
Console.WriteLine(""); | |
Console.WriteLine("TimeStamp:"+ ConvertTimestampToDateTime(double.Parse(wt.timeStamp)).ToString("yyyy-MM-dd HH:mm:ss")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
options: { | |
responsive: true, | |
maintainAspectRatio: false, | |
scales: { | |
yAxes: [{ | |
scaleLabel: { | |
display: true, | |
labelString: '垂直軸的資料名稱' | |
}, | |
ticks: { |