2017-04-27 3 views
1

Ich möchte Währungsformat dynamisch ändern, denke ich bin nah an der Lösung, aber nicht richtige Richtung, so dass einige Hilfe ist sehr spürbar. unten ist mein Code.Währung dynamisch mit irpython Skript in Tibco Spotfire setzen

from Spotfire.Dxp.Application.Visuals import BarChart 
from Spotfire.Dxp.Data import DataType 
from Spotfire.Dxp.Data.Formatters import * 

viz=barchart.As[BarChart]() 
nf = DataType.Real.CreateLocalizedFormatter() 
nf.Category = NumberFormatCategory.Currency 
nf.DecimalDigits = 0; 
viz.YAxis.Scale.Formatting.RealFormatter = nf; 

dieser Code so weit funktioniert, aber wenn ich versuche,
nf.CurrencyCulture='en-US es unter Fehler

TypeError: expected CultureInfo, got str 

Ich versuche, herauszufinden, was ist CultureInfo Typ ist, aber ich bin nicht zu werfen hinzufügen alles bekommen. kann ich etwas verpasst

Antwort

0

Bitte versuchen Sie es this-

from Spotfire.Dxp.Application.Visuals import BarChart 
from Spotfire.Dxp.Data import DataType 
from Spotfire.Dxp.Data.Formatters import * 
from System.Globalization import CultureInfo 

viz=barchart.As[BarChart]() 
nf = DataType.Real.CreateLocalizedFormatter() 
nf.Category = NumberFormatCategory.Currency 
nf.DecimalDigits = 0; 
nf.CultureInfo =CultureInfo("es-ES") 
viz.YAxis.Scale.Formatting.RealFormatter = nf