If I want to change the odometer from miles to kilometers, what are my choices?
Can that be done programmatically, or does it require special parts or is it possible at all. I have a US model 2006 Mazda 5.
You can't.
That's what it boils down to is that you're not legally allowed to change the odometer from miles to kilometers. I'm going to assume that you're a Canadian (like me) looking to take advantage of our strong dollar (like me). I'll also assume that what I know is true, which may or may not be the case.
I was looking at buying a used US 2007 Mazda5 GT and having it imported to Canada. (We found a brand new Canadian 2007 GT for just $1000 more, and then I get $500 MIR from Mazda!) (I haven't introduced myself yet as I don't get the car until tomorrow.) Bear in mind that anything (i.e. Mazdas) made outside of NA (i.e. made in Japan) isn't subject to NAFTA, so you'll have to pay duty along with the GST and PST.
Anyway, you have to keep the speedometer with miles on the outer ring and the odometer in miles so that the next owner can clearly see that the car is an import and used to be an American car. You'll have to get used to doing quick calculations in your head, I'm afraid.
The Registrar of Imported Vehicles (riv.ca) has some details, or you can call your local Canadian Tire. (They are the one contracted with RIV for modifying and inspecting imported vehicles.) If the modifications aren't done correctly, then you could be forced to return the vehicle to the US.
You would also have to claim that the car was registered outside of the province. That's a big hit when selling as well, so if you've got an import with a wonky odo, you're going to end up driving it until you sell it for scrap.