Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GunChleoc
joinpeertube
Commits
1d5c4fa2
Verified
Commit
1d5c4fa2
authored
Mar 03, 2020
by
Chocobozzz
Browse files
Correctly format currency
parent
e1a70e94
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/components/crowdfunding/Project.vue
View file @
1d5c4fa2
...
...
@@ -9,7 +9,7 @@
<div>
<div>
<img
:src=
"
`$
{$root['/']}im
g/process.svg
`
" height="200" alt="" class="pull-right">
<img
:src=
"
buildImgUrl('crowdfundin
g/process.svg
')
"
height=
"200"
alt=
""
class=
"pull-right"
>
<p
v-translate
>
From a birthday party with friends and family to a march for climate change,
...
...
src/mixins/CommonMixins.js
View file @
1d5c4fa2
...
...
@@ -21,7 +21,8 @@ export default {
},
formatCurrency
(
amount
)
{
return
new
Intl
.
NumberFormat
(
'
fr-FR
'
,
{
style
:
'
currency
'
,
currency
:
'
EUR
'
}).
format
(
amount
)
const
options
=
{
style
:
'
currency
'
,
currency
:
'
EUR
'
,
minimumFractionDigits
:
0
,
maximumFractionDigits
:
0
}
return
new
Intl
.
NumberFormat
(
this
.
getShortLocale
(),
options
).
format
(
amount
)
},
getShortLocale
()
{
...
...
src/views/Crowdfunding.vue
View file @
1d5c4fa2
...
...
@@ -25,7 +25,7 @@
</span>
<br>
<span
class=
"text-muted"
v-translate
>
raised on the way to
{{
formatCurrency
(
progress
.
max
)
}}
€
raised on the way to
{{
formatCurrency
(
progress
.
max
)
}}
</span>
</p>
</div>
...
...
@@ -1023,38 +1023,38 @@
amount
:
10
,
rewardsContent
:
{
d1
:
{
title
:
this
.
$gettext
(
'
€1 and more
'
),
title
:
this
.
$gettext
Interpolate
(
'
%{ amount } and more
'
,
{
amount
:
this
.
formatCurrency
(
1
)
}
),
subtitle
:
this
.
$gettext
(
'
<small>equivalent to </small> a hug to the team!
'
),
p
:
this
.
$gettext
(
'
You show us your trust and support, and you contribute to the birth of Mobilizon: THANK YOU
'
)
},
d25
:
{
title
:
this
.
$gettext
(
'
€25 and more
'
),
title
:
this
.
$gettext
Interpolate
(
'
%{ amount } and more
'
,
{
amount
:
this
.
formatCurrency
(
25
)
}
),
subtitle
:
this
.
$gettext
(
'
<small>equivalent to</small> 15 minutes of conversation
'
),
p
:
this
.
$gettext
(
'
Meetings, phone calls and interviews… Sometimes, creating user-friendly software requires more spit than sweat!
'
)
},
d42
:
{
title
:
this
.
$gettext
(
'
€42 and more
'
),
title
:
this
.
$gettext
Interpolate
(
'
%{ amount } and more
'
,
{
amount
:
this
.
formatCurrency
(
42
)
}
),
subtitle
:
this
.
$gettext
(
'
<small>equivalent to</small> one hour of programming
'
),
p
:
this
.
$gettext
(
'
Accounting for payroll expenses, offices, equipment… this is the price of code written in humane conditions.
'
)
},
d88
:
{
title
:
this
.
$gettext
(
'
€88 and more
'
),
title
:
this
.
$gettext
Interpolate
(
'
%{ amount } and more
'
,
{
amount
:
this
.
formatCurrency
(
88
)
}
),
subtitle
:
this
.
$gettext
(
'
<small>equivalent to</small> a brainstorm
'
),
p
:
this
.
$gettext
(
'
Getting together around a whiteboard… that’s how the most beautiful ideas are born!
'
)
},
d130
:
{
title
:
this
.
$gettext
(
'
€130 and more
'
),
title
:
this
.
$gettext
Interpolate
(
'
%{ amount } and more
'
,
{
amount
:
this
.
formatCurrency
(
130
)
}
),
subtitle
:
this
.
$gettext
(
'
<small>equivalent to</small> one UX interview
'
),
p
:
this
.
$gettext
(
'
If you want to design software made for others, you need to ask them about their needs.
'
)
}
},
sponsorsContent
:
{
d1000
:
{
title
:
this
.
$gettext
(
'
€1000 and more
'
),
title
:
this
.
$gettext
Interpolate
(
'
%{ amount } and more
'
,
{
amount
:
this
.
formatCurrency
(
1000
)
}
),
p
:
this
.
$gettext
(
'
Your logo will be highlighted in the joinmobilizon.org hall of fame.
'
)
},
d2500
:
{
title
:
this
.
$gettext
(
'
€2500 and more
'
),
title
:
this
.
$gettext
Interpolate
(
'
%{ amount } and more
'
,
{
amount
:
this
.
formatCurrency
(
2500
)
}
),
p
:
this
.
$gettext
(
'
Your logo will also be shown, by default, in the “About” page of the software.
'
)
}
},
...
...
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