Changed float to decimal for better precision
This commit is contained in:
parent
b425986885
commit
f491c3305c
12
DBClasses.cs
12
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;
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
Loading…
Reference in New Issue