Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
840
Issues
840
List
Boards
Labels
Service Desk
Milestones
Merge Requests
43
Merge Requests
43
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
d202f657
Commit
d202f657
authored
5 hours ago
by
Mark Harding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fix): round to 6 decimals vs 4 and support starting with period - closes
#1902
parent
3c2ef340
master
fix/activity-deletion-detection-1732
No related merge requests found
Pipeline
#82378290
waiting for delayed job with stages
in 51 minutes and 43 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
creator.component.html
src/app/modules/wire/creator/creator.component.html
+1
-1
creator.component.ts
src/app/modules/wire/creator/creator.component.ts
+14
-3
No files found.
src/app/modules/wire/creator/creator.component.html
View file @
d202f657
...
...
@@ -70,7 +70,7 @@
<input
type=
"text"
class=
"m-wire--creator-wide-input--edit"
[ngModel]=
"wire.amount
| number
"
[ngModel]=
"wire.amount"
(ngModelChange)=
"setAmount($event)"
(focus)=
"amountEditorFocus()"
(blur)=
"amountEditorBlur()"
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/wire/creator/creator.component.ts
View file @
d202f657
...
...
@@ -322,13 +322,24 @@ export class WireCreatorComponent {
return
;
}
if
(
amount
.
indexOf
(
'
.
'
)
===
0
)
{
if
(
amount
.
length
===
1
)
{
return
;
// not propogration
}
amount
=
`0
${
amount
}
`
;
}
if
(
typeof
amount
===
'
number
'
)
{
this
.
wire
.
amount
=
amount
;
console
.
log
(
'
amount is a number
'
);
return
;
}
amount
=
amount
.
replace
(
/,/g
,
''
);
this
.
wire
.
amount
=
parseFloat
(
amount
);
const
amountAsFloat
=
parseFloat
(
amount
);
if
(
amountAsFloat
)
{
this
.
wire
.
amount
=
amountAsFloat
;
}
}
/**
...
...
@@ -355,11 +366,11 @@ export class WireCreatorComponent {
}
/**
* Round by
4
* Round by
6
*/
roundAmount
()
{
this
.
wire
.
amount
=
Math
.
round
(
parseFloat
(
`
${
this
.
wire
.
amount
}
`
)
*
10000
)
/
1
0000
;
Math
.
round
(
parseFloat
(
`
${
this
.
wire
.
amount
}
`
)
*
10000
00
)
/
100
0000
;
}
// Charge and rates
...
...
This diff is collapsed.
Click to expand it.
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