File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
govtool/frontend/src/utils Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ changes.
1818
1919- Fix listing voted-on governance actions [ Issue 2379] ( https://github.com/IntersectMBO/govtool/issues/2379 )
2020- Fix wronly displayed markdown on slider card [ Issue 2263] ( https://github.com/IntersectMBO/govtool/issues/2316 )
21+ - fix ada quantities format to avoid thousands when the total is 0 [ Issue 2372] ( https://github.com/IntersectMBO/govtool/issues/2382 )
2122
2223### Changed
2324
Original file line number Diff line number Diff line change @@ -14,12 +14,12 @@ export const correctVoteAdaFormat = (
1414) => {
1515 if ( lovelace ) {
1616 const ada = lovelace / LOVELACE ;
17+
1718 return ada . toLocaleString ( locale , {
18- minimumFractionDigits : 3 ,
1919 maximumFractionDigits : 3 ,
2020 } ) ;
2121 }
22- return "0,000 " ;
22+ return "0" ;
2323} ;
2424
2525export const correctDRepDirectoryFormat = ( lovelace : number | undefined ) => {
Original file line number Diff line number Diff line change @@ -66,19 +66,19 @@ describe("correctVoteAdaFormat", () => {
6666
6767 test ( "Returns 0 for undefined lovelace value" , ( ) => {
6868 const lovelace = undefined ;
69- const expectedResult = "0,000 " ;
69+ const expectedResult = "0" ;
7070 expect ( correctVoteAdaFormat ( lovelace , "en-US" ) ) . toBe ( expectedResult ) ;
7171 } ) ;
7272
7373 test ( "Returns 0 for zero lovelace value" , ( ) => {
7474 const lovelace = 0 ;
75- const expectedResult = "0,000 " ;
75+ const expectedResult = "0" ;
7676 expect ( correctVoteAdaFormat ( lovelace , "en-US" ) ) . toBe ( expectedResult ) ;
7777 } ) ;
7878
7979 test ( "Returns 0 for small lovelace value" , ( ) => {
8080 const lovelace = 123 ;
81- const expectedResult = "0.000 " ;
81+ const expectedResult = "0" ;
8282 expect ( correctVoteAdaFormat ( lovelace , "en-US" ) ) . toBe ( expectedResult ) ;
8383 } ) ;
8484} ) ;
You can’t perform that action at this time.
0 commit comments