Log10 function in Xojo

Hi,

I need to find the order of magnitude of a number (example: 0.01 => M = -2 or 100 => M = 2), so a Log10 function would be exactly what I need. However I could not find it in Xojo, as only natural Log function is available. Can you confirm this? If so, any (short) workarounds?

Thanks.

One possibility may be to divide the natural log result of any number N by the result of natural log of number 10.

Log10 of N = (Natural Log of N) / (Natural Log of 10)

1 Like

[quote=121948:@Syed Hassan]One possibility may be to divide the natural log result of any number N by the result of natural log of number 10.

Log10 of N = (Natural Log of N) / (Natural Log of 10)[/quote]

That is the right way. Most older calculators only had natural logs, so one of the first thing they taught in some math classes was to use the natural log to convert between any base.

thanks, that’s the answer. Why didn’t I think of it? :slight_smile: