You can use UnitConvert
to convert money quantities to "SingaporeDollars". Here's a function to do this:
toNativeCurrency[e_Entity] := With[
{c = e["City"]["Country"]["CurrencyCode"]},
e["Dataset"][All, Replace[q_Quantity?MoneyQ :> UnitConvert[q, c]]]
]
MoneyQ[q_Quantity] := !FreeQ[UnitDimensions[q], "MoneyUnit"]
For your company (all those currency conversions are slow):
dataset = toNativeCurrency[Entity["Company","SingaporePressHoldings::dngt3"]]
Look at the InputForm
to verify that the correct currency is being used:
Normal[dataset][[1]] //InputForm
Quantity[1.7875263488897222*^8, "SingaporeDollars"]
Addendum
If you want to convert currencies using the date of the property, then you can use the Dated
function. For example:
UnitConvert[
Quantity[23, Dated["USDollars", {2019,1,1}]/"Years"],
Dated["SGD", {2019,1,1}]
]
Quantity[31.52219146124501, "Years"^(-1) DatedUnit["SingaporeDollars", {2019, 1, 1}]]
The following function carries out this idea:
toNativeCurrency[e_Entity] := With[
{c = e["City"]["Country"]["CurrencyCode"]},
KeyValueMap[<|#1 -> toDatedCurrency[Quiet[e[#1, "Date"]], #2, c]|>&, e["Dataset"]]
]
MoneyQ[q_Quantity] := !FreeQ[UnitDimensions[q], "MoneyUnit"]
toDatedCurrency[date_DateObject, value_, c_] := ReplaceAll[
value,
Quantity[v_, u_] /; !FreeQ[u, "USDollars"] :> UnitConvert[
Quantity[v, u] /. "USDollars" -> Dated["USDollars", date],
Dated[c, date]
]
]
toDatedCurrency[_, value_, _] := value
For your company (all those currency conversions are slow):
dataset = toNativeCurrency[Entity["Company","SingaporePressHoldings::dngt3"]]
You might ask another question about how to format dated quantities so that they look better.