Forum Discussion
Martin18
8 years agoNew Member
valueFormatter ignores culture for displayUnit
Hi all,
I'm having little trouble with valueFormatter as I can't get it format my values as expected in terms of the unit abbreviation and the given culture. Even though it produces the correct decimal character (comma), the unit abbreviation still looks like for the default culture ("en-US").
Here's what I've done:
visual.ts:
import valueFormatter = powerbi.extensibility.utils.formatting.valueFormatter;pbiviz.json:
...
let formatterOptions : utils.formatting.ValueFormatterOptions = {
value: 1000,
precision: 1,
cultureSelector: options.host.locale // "de-DE"
};
let formatter = valueFormatter.create(formatterOptions);
let v = formatter.format(2500); // gives 2,5K and not 2,5 Tsd. :-(
...Is there anything wrong with my code?
"externalJS": [ "node_modules/globalize/lib/globalize.js", "node_modules/globalize/lib/cultures/globalize.cultures.js",
...
Any help will be appreciated. Thank you.
It looks like postfix has not been localized for all of languages.
Please create a new bug in GitHub: https://github.com/Microsoft/powerbi-visuals-utils-formattingutils
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
3 Replies
- v-viigCommunity Champion
It looks like postfix has not been localized for all of languages.
Please create a new bug in GitHub: https://github.com/Microsoft/powerbi-visuals-utils-formattingutils
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals