Haven't most of these codebases moved to C#/Java over the past 20 years? I feel like Cobol is truly a thing of the past, even for your average old-school bank/insurance behemoth, but then I might live in a bubble.
Some has, but there's still a very large and active COBOL installed base, and there's still active COBOL development taking place.
In fact, COBOL devs tend to be better paid these days, because they're critical but there are fewer of them.
The deal is that companies who rely on such software have a solid, time-proven, solution. Switching that out just to change to a different language would be irresponsibly risky.
Does Java (or it's programmers) know how to represent decimal numbers and fractions at the machine level?
COBOL is used in banking because it natively supported decimal floats from the 70s or some crap, and no other language bothers to truly try and be a COBOL replacement.
Banking / insurance / etc etc are on the Dollar/Penny system. They need 0.01 to be exactly 0.01, and not 0.09999997 or whatever double precision decides to round that to.
And remember, there are fractions of a penny. Ex: $15.097 could be a real price that needs to be exactly calculated.
-------
If this crap hasn't been figured out in the last 20 years, why would Java or C# programmers try to solve it in the next 20 years?
It's more likely for the old COBOL code to just keep running along than to port over to a language that doesn't even meet your legal requirements.
> "If this crap hasn't been figured out in the last 20 years, why would Java or C# programmers try to solve it in the next 20 years?"
C# has had System.Decimal since .NET Standard 1.0 over 20 years ago: https://learn.microsoft.com/en-us/dotnet/api/system.decimal?... - "Decimal value type is appropriate for financial calculations that require large numbers of significant integral and fractional digits and no round-off errors."