Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Breeze
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
Breeze
Commits
b7bc79ba
Commit
b7bc79ba
authored
Sep 26, 2017
by
dev0tion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Stratis to coin notation pipe
parent
7c08b643
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
coin-notation.pipe.ts
Breeze.UI/src/app/shared/pipes/coin-notation.pipe.ts
+23
-1
No files found.
Breeze.UI/src/app/shared/pipes/coin-notation.pipe.ts
View file @
b7bc79ba
import
{
Pipe
,
PipeTransform
}
from
'@angular/core'
;
import
{
GlobalService
}
from
'../services/global.service'
;
@
Pipe
({
name
:
'coinNotation'
})
export
class
CoinNotationPipe
implements
PipeTransform
{
constructor
(
private
globalService
:
GlobalService
)
{
this
.
setCoinUnit
();
}
private
coinUnit
=
"BTC"
;
private
coinName
=
this
.
globalService
.
getCoinName
();
private
coinUnit
:
string
;
private
coinNotation
:
number
;
private
decimalLimit
=
8
;
...
...
@@ -22,10 +27,27 @@ export class CoinNotationPipe implements PipeTransform {
case
"uBTC"
:
temp
=
value
/
100
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TuBTC"
;
case
"STRAT"
:
temp
=
value
/
100000000
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TSTRAT"
;
case
"mSTRAT"
:
temp
=
value
/
100000
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TmSTRAT"
;
case
"uSTRAT"
:
temp
=
value
/
100
;
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TuSTRAT"
;
}
}
}
setCoinUnit
()
{
if
(
this
.
coinName
===
"Bitcoin"
)
{
this
.
coinUnit
=
"BTC"
;
}
else
if
(
this
.
coinName
===
"Stratis"
)
{
this
.
coinUnit
=
"STRAT"
}
};
getCoinUnit
()
{
return
this
.
coinUnit
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment