@@ -20,6 +20,7 @@ QList<BitcoinUnits::Unit> BitcoinUnits::availableUnits()
20
20
unitlist.append (BTC);
21
21
unitlist.append (mBTC );
22
22
unitlist.append (uBTC);
23
+ unitlist.append (SAT);
23
24
return unitlist;
24
25
}
25
26
@@ -30,6 +31,7 @@ bool BitcoinUnits::valid(int unit)
30
31
case BTC:
31
32
case mBTC :
32
33
case uBTC:
34
+ case SAT:
33
35
return true ;
34
36
default :
35
37
return false ;
@@ -43,6 +45,7 @@ QString BitcoinUnits::longName(int unit)
43
45
case BTC: return QString (" BTC" );
44
46
case mBTC : return QString (" mBTC" );
45
47
case uBTC: return QString::fromUtf8 (" µBTC (bits)" );
48
+ case SAT: return QString (" Satoshi (sat)" );
46
49
default : return QString (" ???" );
47
50
}
48
51
}
@@ -52,7 +55,8 @@ QString BitcoinUnits::shortName(int unit)
52
55
switch (unit)
53
56
{
54
57
case uBTC: return QString::fromUtf8 (" bits" );
55
- default : return longName (unit);
58
+ case SAT: return QString (" sat" );
59
+ default : return longName (unit);
56
60
}
57
61
}
58
62
@@ -63,6 +67,7 @@ QString BitcoinUnits::description(int unit)
63
67
case BTC: return QString (" Bitcoins" );
64
68
case mBTC : return QString (" Milli-Bitcoins (1 / 1" THIN_SP_UTF8 " 000)" );
65
69
case uBTC: return QString (" Micro-Bitcoins (bits) (1 / 1" THIN_SP_UTF8 " 000" THIN_SP_UTF8 " 000)" );
70
+ case SAT: return QString (" Satoshi (sat) (1 / 100" THIN_SP_UTF8 " 000" THIN_SP_UTF8 " 000)" );
66
71
default : return QString (" ???" );
67
72
}
68
73
}
@@ -71,10 +76,11 @@ qint64 BitcoinUnits::factor(int unit)
71
76
{
72
77
switch (unit)
73
78
{
74
- case BTC: return 100000000 ;
79
+ case BTC: return 100000000 ;
75
80
case mBTC : return 100000 ;
76
81
case uBTC: return 100 ;
77
- default : return 100000000 ;
82
+ case SAT: return 1 ;
83
+ default : return 100000000 ;
78
84
}
79
85
}
80
86
@@ -85,6 +91,7 @@ int BitcoinUnits::decimals(int unit)
85
91
case BTC: return 8 ;
86
92
case mBTC : return 5 ;
87
93
case uBTC: return 2 ;
94
+ case SAT: return 0 ;
88
95
default : return 0 ;
89
96
}
90
97
}
0 commit comments