getPreferredUnit function
Gets the appropriate unit type for a metric.
Implementation
String getPreferredUnit(FinancialMetric metric) {
switch (metric) {
case FinancialMetric.earningsPerShareBasic:
case FinancialMetric.earningsPerShareDiluted:
case FinancialMetric.dividendsPerShare:
return 'USD/shares';
case FinancialMetric.sharesOutstanding:
return 'shares';
default:
return 'USD';
}
}