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
742c231f
Commit
742c231f
authored
Jun 28, 2017
by
dev0tion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve coin notation pipe
parent
c793a2da
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
43 deletions
+26
-43
coin-abbreviation.pipe.spec.ts
...ze.UI/src/app/shared/pipes/coin-abbreviation.pipe.spec.ts
+0
-8
coin-abbreviation.pipe.ts
Breeze.UI/src/app/shared/pipes/coin-abbreviation.pipe.ts
+0
-14
coin-notation.pipe.ts
Breeze.UI/src/app/shared/pipes/coin-notation.pipe.ts
+20
-14
shared.module.ts
Breeze.UI/src/app/shared/shared.module.ts
+2
-3
dashboard.component.html
Breeze.UI/src/app/wallet/dashboard/dashboard.component.html
+3
-3
history.component.html
Breeze.UI/src/app/wallet/history/history.component.html
+1
-1
No files found.
Breeze.UI/src/app/shared/pipes/coin-abbreviation.pipe.spec.ts
deleted
100644 → 0
View file @
c793a2da
import
{
CoinAbbreviationPipe
}
from
'./coin-abbreviation.pipe'
;
describe
(
'CoinAbbreviationPipe'
,
()
=>
{
it
(
'create an instance'
,
()
=>
{
const
pipe
=
new
CoinAbbreviationPipe
();
expect
(
pipe
).
toBeTruthy
();
});
});
Breeze.UI/src/app/shared/pipes/coin-abbreviation.pipe.ts
deleted
100644 → 0
View file @
c793a2da
import
{
Pipe
,
PipeTransform
}
from
'@angular/core'
;
@
Pipe
({
name
:
'coinAbbreviation'
})
export
class
CoinAbbreviationPipe
implements
PipeTransform
{
transform
(
value
:
any
):
any
{
if
(
!
value
)
return
value
;
let
abbreviationAdded
=
value
+
" TBTC"
return
abbreviationAdded
;
}
}
Breeze.UI/src/app/shared/pipes/coin-notation.pipe.ts
View file @
742c231f
...
@@ -7,22 +7,28 @@ export class CoinNotationPipe implements PipeTransform {
...
@@ -7,22 +7,28 @@ export class CoinNotationPipe implements PipeTransform {
private
coinUnit
=
"BTC"
;
private
coinUnit
=
"BTC"
;
private
coinNotation
:
number
;
private
coinNotation
:
number
;
private
decimalLimit
=
8
;
transform
(
value
:
any
):
any
{
transform
(
value
:
any
):
any
{
if
(
!
value
)
return
value
;
let
temp
;
if
(
typeof
value
===
'number'
)
{
this
.
coinNotation
=
value
;
switch
(
this
.
getCoinUnit
())
{
case
"BTC"
:
switch
(
this
.
coinUnit
)
{
temp
=
value
/
100000000
;
case
"BTC"
:
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TBTC"
;
this
.
coinNotation
=
Number
(
value
.
toFixed
(
8
));
case
"mBTC"
:
return
this
.
coinNotation
=
this
.
coinNotation
/
100000000
;
temp
=
value
/
100000
;
case
"mBTC"
:
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TmBTC"
;
this
.
coinNotation
=
Number
(
value
.
toFixed
(
8
));
case
"uBTC"
:
return
this
.
coinNotation
=
this
.
coinNotation
/
100000
;
temp
=
value
/
100
;
case
"uBTC"
:
return
temp
.
toFixed
(
this
.
decimalLimit
)
+
" TuBTC"
;
this
.
coinNotation
=
Number
(
value
.
toFixed
(
8
));
}
return
this
.
coinNotation
=
this
.
coinNotation
/
100
;
}
}
}
}
getCoinUnit
()
{
return
this
.
coinUnit
;
}
}
}
Breeze.UI/src/app/shared/shared.module.ts
View file @
742c231f
import
{
NgModule
,
ModuleWithProviders
}
from
'@angular/core'
;
import
{
NgModule
,
ModuleWithProviders
}
from
'@angular/core'
;
import
{
CommonModule
}
from
'@angular/common'
;
import
{
CommonModule
}
from
'@angular/common'
;
import
{
CoinNotationPipe
}
from
'./pipes/coin-notation.pipe'
;
import
{
CoinNotationPipe
}
from
'./pipes/coin-notation.pipe'
;
import
{
CoinAbbreviationPipe
}
from
'./pipes/coin-abbreviation.pipe'
;
@
NgModule
({
@
NgModule
({
imports
:
[
CommonModule
],
imports
:
[
CommonModule
],
declarations
:
[
CoinNotationPipe
,
CoinAbbreviationPipe
],
declarations
:
[
CoinNotationPipe
],
exports
:
[
CoinNotationPipe
,
CoinAbbreviationPipe
]
exports
:
[
CoinNotationPipe
]
})
})
export
class
SharedModule
{
export
class
SharedModule
{
...
...
Breeze.UI/src/app/wallet/dashboard/dashboard.component.html
View file @
742c231f
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
<div
class=
"d-flex flex-row align-items-center nopadding"
id=
"dashboard"
>
<div
class=
"d-flex flex-row align-items-center nopadding"
id=
"dashboard"
>
<div
class=
"d-flex flex-column"
>
<div
class=
"d-flex flex-column"
>
<div
class=
"p"
>
Active Balance
</div>
<div
class=
"p"
>
Active Balance
</div>
<div
class=
"p"
>
Balance: {{confirmedBalance | coinNotation
| coinAbbreviation
}}
</div>
<div
class=
"p"
>
Balance: {{confirmedBalance | coinNotation }}
</div>
<div
class=
"p"
>
Unconfirmed Balance: {{unconfirmedBalance | coinNotation
| coinAbbreviation
}}
</div>
<div
class=
"p"
>
Unconfirmed Balance: {{unconfirmedBalance | coinNotation }}
</div>
</div>
</div>
<div
class=
"d-flex flex-column"
>
<div
class=
"d-flex flex-column"
>
<!--<div>Current Value</div>
<!--<div>Current Value</div>
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
<!--<td *ngIf="{{ transaction.amount }} < 0">SENT</td>
<!--<td *ngIf="{{ transaction.amount }} < 0">SENT</td>
<td *ngIf="{{ transaction.amount }} > 0">RECEIVED</td>-->
<td *ngIf="{{ transaction.amount }} > 0">RECEIVED</td>-->
<td
*
ngIf=
"i<5"
>
{{ transaction.type }}
</td>
<td
*
ngIf=
"i<5"
>
{{ transaction.type }}
</td>
<td
*
ngIf=
"i<5"
>
{{ transaction.amount | coinNotation
| coinAbbreviation
}}
</td>
<td
*
ngIf=
"i<5"
>
{{ transaction.amount | coinNotation }}
</td>
<td
*
ngIf=
"i<5"
>
{{ transaction.id }}
</td>
<td
*
ngIf=
"i<5"
>
{{ transaction.id }}
</td>
<td
*
ngIf=
"i<5"
>
{{ transaction.confirmedInBlock }}
</td>
<td
*
ngIf=
"i<5"
>
{{ transaction.confirmedInBlock }}
</td>
<td
*
ngIf=
"i<5"
>
{{ transaction.timestamp * 1000 | date:'medium' }}
</td>
<td
*
ngIf=
"i<5"
>
{{ transaction.timestamp * 1000 | date:'medium' }}
</td>
...
...
Breeze.UI/src/app/wallet/history/history.component.html
View file @
742c231f
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<!--<td *ngIf="{{ transaction.amount }} < 0; else received">SENT</td>
<!--<td *ngIf="{{ transaction.amount }} < 0; else received">SENT</td>
<td #received>RECEIVED</td>-->
<td #received>RECEIVED</td>-->
<td>
{{ transaction.type }}
</td>
<td>
{{ transaction.type }}
</td>
<td>
{{ transaction.amount | coinNotation
| coinAbbreviation
}}
</td>
<td>
{{ transaction.amount | coinNotation }}
</td>
<td>
{{ transaction.id }}
</td>
<td>
{{ transaction.id }}
</td>
<td>
{{ transaction.confirmedInBlock }}
</td>
<td>
{{ transaction.confirmedInBlock }}
</td>
<td>
{{ transaction.timestamp * 1000 | date:'medium' }}
</td>
<td>
{{ transaction.timestamp * 1000 | date:'medium' }}
</td>
...
...
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