cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Martin18 New Member
New 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;
...
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. 😞
pbiviz.json:
 
... 
"externalJS": [ "node_modules/globalize/lib/globalize.js", "node_modules/globalize/lib/cultures/globalize.cultures.js",
...
Is there anything wrong with my code?
 
Any help will be appreciated. Thank you.
1 ACCEPTED SOLUTION

Accepted Solutions
Moderator v-viig
Moderator

Re: valueFormatter ignores culture for displayUnit

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

pbicvsupport@microsoft.com

View solution in original post

3 REPLIES 3
Moderator v-viig
Moderator

Re: valueFormatter ignores culture for displayUnit

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

pbicvsupport@microsoft.com

View solution in original post

popov Member
Member

Re: valueFormatter ignores culture for displayUnit

I'm using formatting utils with new powerbi-visual-tools 3 (beta) and get some behavior. When this bug will fix?

Moderator v-viig
Moderator

Re: valueFormatter ignores culture for displayUnit

Did you face exactly the same issue?

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 303 members 2,943 guests