Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Summative_Jordan_Dalby
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jordan.dalby
Summative_Jordan_Dalby
Commits
403e83b4
Commit
403e83b4
authored
Apr 07, 2021
by
jordan.dalby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed enter amount problem related to currency
parent
6708c96f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
BookPayment.java
app/src/main/java/com/yorksj/museumapp/BookPayment.java
+5
-5
BookSouvenir.java
app/src/main/java/com/yorksj/museumapp/BookSouvenir.java
+1
-1
activity_book_souvenir.xml
app/src/main/res/layout/activity_book_souvenir.xml
+1
-1
No files found.
app/src/main/java/com/yorksj/museumapp/BookPayment.java
View file @
403e83b4
...
...
@@ -98,7 +98,7 @@ public class BookPayment extends AppCompatActivity implements TextWatcher
Locale
locale
=
getResources
().
getConfiguration
().
getLocales
().
get
(
0
);
String
currencySymbol
=
NumberFormat
.
getCurrencyInstance
(
locale
).
getCurrency
().
get
CurrencyCode
();
String
currencySymbol
=
NumberFormat
.
getCurrencyInstance
(
locale
).
getCurrency
().
get
Symbol
();
String
clean
=
s
.
toString
().
replaceAll
(
"["
+
currencySymbol
+
",.]"
,
""
);
...
...
@@ -147,7 +147,7 @@ public class BookPayment extends AppCompatActivity implements TextWatcher
if
(
amt
==
0
)
continue
;
nameBuilder
.
append
(
item
.
displayName
+
"\n"
);
nameBuilder
.
append
(
getString
(
item
.
displayName
)
+
"\n"
);
quantityBuilder
.
append
(
String
.
valueOf
(
amt
)
+
"\n"
);
costBuilder
.
append
(
NumberFormat
.
getCurrencyInstance
(
locale
).
format
(
item
.
cost
*
amt
)
+
"\n"
);
b
=
true
;
...
...
@@ -168,7 +168,7 @@ public class BookPayment extends AppCompatActivity implements TextWatcher
continue
;
b
=
true
;
nameBuilder
.
append
(
item
.
displayName
+
"\n"
);
nameBuilder
.
append
(
getString
(
item
.
displayName
)
+
"\n"
);
quantityBuilder
.
append
(
String
.
valueOf
(
amt
)
+
"\n"
);
costBuilder
.
append
(
NumberFormat
.
getCurrencyInstance
(
locale
).
format
(
item
.
cost
*
amt
)
+
"\n"
);
}
...
...
@@ -220,9 +220,9 @@ public class BookPayment extends AppCompatActivity implements TextWatcher
enterAmount
.
removeTextChangedListener
(
this
);
Locale
locale
=
getResources
().
getConfiguration
().
getLocales
().
get
(
0
);
String
currency
=
NumberFormat
.
getCurrencyInstance
(
locale
).
getCurrency
().
get
CurrencyCode
();
String
currency
=
NumberFormat
.
getCurrencyInstance
(
locale
).
getCurrency
().
get
Symbol
();
String
clean
=
s
.
toString
().
replaceAll
(
"["
+
currency
+
",.]"
,
""
);
String
clean
=
s
.
toString
().
replaceAll
(
"["
+
currency
+
",.]"
,
""
);
// TODO: Fix this
double
parsed
=
Double
.
parseDouble
(
clean
);
String
formatted
=
NumberFormat
.
getCurrencyInstance
(
locale
).
format
((
parsed
/
100
));
...
...
app/src/main/java/com/yorksj/museumapp/BookSouvenir.java
View file @
403e83b4
...
...
@@ -106,7 +106,7 @@ public class BookSouvenir extends AppCompatActivity
String
s
=
"\t\t"
+
getString
(
R
.
string
.
cafeTotal
)
+
" \t\t\t\t"
+
NumberFormat
.
getCurrencyInstance
(
locale
).
format
(
bookPacket
.
cafe
.
getTotal
())
+
"\n+\t"
+
getString
(
R
.
string
.
souvenirTotal
)
+
" \t"
+
NumberFormat
.
getCurrencyInstance
(
locale
).
format
(
bookPacket
.
souvenir
.
getTotal
())
+
"\n+\t"
+
getString
(
R
.
string
.
entranceFee
)
+
" \t\t"
+
NumberFormat
.
getCurrencyInstance
(
locale
).
format
(
bookPacket
.
museumPacket
.
entranceFee
)
+
"\n=\t"
+
getString
(
R
.
string
.
cafeT
otal
)
+
" \t\t\t\t\t\t\t\t\t"
+
NumberFormat
.
getCurrencyInstance
(
locale
).
format
((
bookPacket
.
souvenir
.
getTotal
()
+
bookPacket
.
museumPacket
.
entranceFee
));
"\n=\t"
+
getString
(
R
.
string
.
t
otal
)
+
" \t\t\t\t\t\t\t\t\t"
+
NumberFormat
.
getCurrencyInstance
(
locale
).
format
((
bookPacket
.
souvenir
.
getTotal
()
+
bookPacket
.
museumPacket
.
entranceFee
));
subtotal
.
setText
(
s
);
}
...
...
app/src/main/res/layout/activity_book_souvenir.xml
View file @
403e83b4
...
...
@@ -312,7 +312,7 @@
android:id=
"@+id/snowglobeName"
android:layout_width=
"92dp"
android:layout_height=
"22dp"
android:layout_marginStart=
"2
52
dp"
android:layout_marginStart=
"2
40
dp"
android:layout_marginTop=
"8dp"
android:text=
"@string/snowglobe"
android:textAlignment=
"center"
...
...
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