I can convert from unhardened to hardened, but my question was how to convert the other way around.
yeah, you subtract but it still doesn't make sense in practice. it would be like saying second day of the week is Monday, i want to know what is the first day of the week so i subtract 1 from Monday. it obviously works but you should already know it is Sunday.
if you are coding for example in c# you hard code an enum that contains the names and their values like this:
enum Bip44Indices : uint
{
BTC = 0x80000000,
TestNet = 0x80000001,
LTC = 0x80000002,
....
BCH = 0x80000091,
....
}
then you use that wherever in your code you want.