I’m feeling generous today, so here’s a link to my local Thai Takeaway, who seem to be rather unloved by Google, and maybe a link to them will help.
Real world address:
Tasty Thai Takeaway
10 Wostenholm Road
Phone: 0114 327 0990
They’re closed on Tuesdays – otherwise you should try them out!
Int to Real
D = A + B x 10 ^ (-C)
Real to Int
A = XXXXXX.YYYYYY
C = XXXXXX
D = Round 0.YYYYYY to B decimal places, then multiply by 10 ^ B
At least I think this is what it’s supposed to do – it seems to have some issues:
- Rounding close to 0.5 can be somewhat unpredictable. e.g. A = 5.246, B = 1 will give D=3, not D=2 as it should.
- Note that the Integer part is always simply truncated – don’t expect this function to Round correctly – e.g. A = 12.99, B = 1 will give C=12 and D=10, instead of C=13, D=0 as you might expect!