diff --git a/DBClasses.cs b/DBClasses.cs index a78ddb9..6d939a1 100644 --- a/DBClasses.cs +++ b/DBClasses.cs @@ -62,10 +62,10 @@ namespace CryptoCalc public int WalletID { get; set; } public string Currency { get; set; } - public float Amount { get; set; } + public decimal Amount { get; set; } public string TransactionType { get; set; } public string FeeCurrency { get; set; } - public float FeeAmount { get; set; } + public decimal FeeAmount { get; set; } public string Platform { get; set; } public string Note { get; set; } @@ -75,7 +75,7 @@ namespace CryptoCalc public Transaction() { SetDBStrings(); } - public Transaction(int walletID, string currency, float amount, string type) + public Transaction(int walletID, string currency, decimal amount, string type) { SaveUnixTimeNow(); WalletID = walletID; @@ -89,7 +89,7 @@ namespace CryptoCalc SetDBStrings(); } - public Transaction(string currency, float amount, string type, string feeCurrency, float feeAmount) + public Transaction(string currency, decimal amount, string type, string feeCurrency, decimal feeAmount) { SaveUnixTimeNow(); Currency = currency; @@ -156,7 +156,7 @@ namespace CryptoCalc public string Platform { get; set; } public string Name { get; set; } public string Currency { get; set; } - public float Balance { get; set; } + public decimal Balance { get; set; } public int DefaultWallet { get; set; } public string Note { get; set; } @@ -173,7 +173,7 @@ namespace CryptoCalc Platform = platform; Name = name; Currency = currency; - Balance = 0; + Balance = 0M; DefaultWallet = 0; Note = note; diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index c0e298b..f54df46 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -49,7 +49,7 @@ namespace CryptoCalc new Transaction( selectedWallet.Index, inputCurrency.Text, - Convert.ToSingle(inputAmount.Text), + Convert.ToDecimal(inputAmount.Text), inputType.Text ) ); @@ -110,7 +110,7 @@ namespace CryptoCalc t.WalletID = selectedWallet.Index; t.SaveUnixTimeNow(); t.Currency = "SOL"; - t.Amount = Convert.ToSingle(30 * rand.NextDouble()); + t.Amount = Convert.ToDecimal(30 * rand.NextDouble()); t.TransactionType = "BUY"; t.Platform = "Firi"; t.Note = "Test";