I have CountryData coming in via e.g.
Entity["Country", "Australia"][
EntityProperty["Country", "GDP",
{"CurrencyUnit" -> "Constant2000USDollar",
"TimeSeriesOperator" -> "AnnualGrowthRate"}
]
]
Which returns
-0.00383656% per year (* unit: percent per year *)
My desired output is -0.0000383656 (i.e. as purely a decimal number).
I am surprised by how hard it has been to find an answer. Despite this question being very simple, I can't find a way with Quantity, NumberForm, etc.
QuantityMagnitude[r]/100whereris your result you obtained from that long command.-0.0000383656– Nasser Nov 28 '22 at 09:43yourresult[[1]]– Daniel Huber Nov 28 '22 at 10:08FullFormyou can see the structure of the returnvalue: FullForm[r] gives you Quantity[-0.0038365585665900404`,Times["Percent",Power["Years",-1]]] – Mathias Nov 28 '22 at 17:32TreeFormif you want something more visual.TreeFormcan be nice when you have nested structures. For example compare{{{s, l}}, {{u, {j}}}} // TreeFormwithk[s + l] + o[u + m[j]] // TreeForm(the variables should not be assigned a value). That shows how symbolically a list, an expression or a wrapper it's basically the same with different letters. The only thing I would add is that mathematica functions sometimes treat lists differently than other objects but often functions that work for lists work for expressions. – userrandrand Nov 29 '22 at 02:14ExpressionTreebut that one is newer and I do not know how reliable it is. – userrandrand Nov 29 '22 at 02:23FullForm,TreeFormandExpressionTreemight lead to expressions that are too lengthy at times in which case you can considerInputFormafter getting familiar with outputs ofFullForm– userrandrand Nov 29 '22 at 02:29FullForm,TreeFormandExpressionTreemight lead to expressions that are too lengthy at times in which case you can considerInputFormafter getting familiar with outputs ofFullForm. At a more advanced level note that some objects likeGraphsthat areAtomicQmight not seem to be when you look at theFullFormas it would seem that you could usePartorReplace. ButFullFormjust provides a visualization of the structure if the object isAtomicQand does not show all of the information in the internal representation/code of the object. – userrandrand Nov 29 '22 at 02:35ReplaceAllnot working even thoughFullFormwould suggest it to be possible see https://mathematica.stackexchange.com/q/275837/86543. For a list of Atomic objects seeEntityClass["WolframLanguageSymbol", "Atomic"]//EntityList– userrandrand Nov 29 '22 at 02:41