Little bit of everything!

Avid Swiftie (come join us at [email protected] )

Gaming (Mass Effect, Witcher, and too much Satisfactory)

Sci-fi

I live for 90s TV sitcoms

  • 1 Post
  • 10 Comments
Joined 2 years ago
cake
Cake day: June 2nd, 2023

help-circle
  • Right but then you have to pass that information around so people know how to deserialize it, and it means things like the UI need to do exact currency conversions on their side that must match the server too. So if you are doing USD you would not only need to pass 1000 to denote $10 but also the currency name, USD, and it’s precision value of 2. However if you are using the Dinar, and they pass the same 1000 they would need to make sure they pass the precision of 3, and the UI would need to calculate that. (And remember JS is floats, so you run the risk there that the value may not be the same as what the server would see)

    The best course of action is to format it on the server. I’ve found that passing the currency code is good along with the stringified value of “10.00” or in the Dinar case “1.000”. That way the UI knows exactly what it should show. Its also extremely rare that someone needs to modify a value on the frontend, but if they do most currency libraries prefer string anyway.

    Source: I’ve done FinTech for trading companies, banks, and payment processors. There are a lot of gotchas with money









  • Persistent storage should never be used for logging in docker. Nextcloud is one of the worst offenders of breaking docker conventions I’ve found, this is just one of the many ways they prove they don’t understand docker.

    Logs should simply be logged to stdout, which will be read by docker or by a logging framework. There should never be “log files” for a container, as it should be immutable, with persistent volumes only being used for configuration or application state.