IFRCGo / go-api

MIT License
14 stars 6 forks source link

[Staging] Rounding rules #1272

Open szabozoltan69 opened 2 years ago

szabozoltan69 commented 2 years ago

Issue

Some figures on GO frontend appears like this: kép

Expected behaviour

GO should round figures already on backend and send the usable values. Not only to integers, but: For numbers between 100 and 1000, we have rounded to the nearest 10. For numbers greater than or equal to 1000, we have rounded to the nearest 100.

To be cross-checked with @justinginnetti @LukeCaley @tovari

LukeCaley commented 2 years ago

Excellent work, thanks @szabozoltan69

justinginnetti commented 2 years ago

Thanks, @szabozoltan69 -- when you are ready for me to check this, let me know. Perhaps once DFS has pushed the risk module to the staging server?

justinginnetti commented 2 years ago

@LukeCaley and @tovari , are the rounding rules above okay with you? Maybe we see what our figures look like on the staging server with these rules in place and then if something looks off we can adjust?

szabozoltan69 commented 2 years ago

@justinginnetti Yes, with a clear starting point it's easier to find the root cause. If it was discovered via the risk module, then after that deployment it's better to begin. Or if you can tell an other issue (which is already on the server) then I can begin it with that. (I think that on GO API the integers are integers, but the 10-rounding and 100-rounding are definitely missing.)

nanometrenat commented 6 months ago

Hi @szabozoltan69 is further work (either reqs/design or dev) required on this ticket? FYI I notice that the total funding requirements sent in the weekly automatic update emails are now into the billions but no drama! image

szabozoltan69 commented 6 months ago

Thanks @nanometrenat – I think that the rewrote frontend already handles these rules fine. (Maybe backend/emailsending not so perfectly, true. Could you paste here an example?)

nanometrenat commented 6 months ago

Thanks @szabozoltan69 - if the rewritten front end handles this fine then that's the original ticket solved, thank you, I will close this ticket now.

If someone wants to change the emails then they can log a separate ticket about that (with xref). THANKS!

justinginnetti commented 6 months ago

I don't think this issue has been fully resolved. Here's a screenshot from the Cameroon country page's Risk Watch tab:

Screenshot 2024-04-16 at 13 28 12
szabozoltan69 commented 6 months ago

Sorry, it was my bad to say a false OK to this. I think that the frontend changes tried only to handle the big numbers fine, putting the delimiters to their correct place, but I think that the rounding steps only happens for "big displays" like key figures, and not all the numbers throughout the website. Should it be thus? @justinginnetti @frozenhelium

nanometrenat commented 6 months ago

Thanks @szabozoltan69 - @LukeCaley confirms we're to discuss the business rules around this before confirming 100% how widely (beyond risk pages) the rounding should apply.