• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DecimalFormat类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.ibm.icu.text.DecimalFormat的典型用法代码示例。如果您正苦于以下问题:Java DecimalFormat类的具体用法?Java DecimalFormat怎么用?Java DecimalFormat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DecimalFormat类属于com.ibm.icu.text包,在下文中一共展示了DecimalFormat类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: style

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
@Override
public PatternNode style(java.lang.String argumentName) {
    Function<Locale, NumberFormat> formatFactory = Opt(() -> {
        Str(",");
        whiteSpace();
        Function<Locale, NumberFormat> result = this
                .<Function<Locale, NumberFormat>> FirstOf(() -> {
            Str("integer");
            return l -> NumberFormat.getIntegerInstance(l);
        } , () -> {
            Str("currency");
            return l -> NumberFormat.getCurrencyInstance(l);
        } , () -> {
            Str("percent");
            return l -> NumberFormat.getPercentInstance(l);
        } , () -> {
            String pattern = subFormatPattern();
            return l -> new DecimalFormat(pattern,
                    DecimalFormatSymbols.getInstance(l));
        });
        whiteSpace();
        return result;
    }).orElse(l -> NumberFormat.getInstance(l));
    return new FormatNode(argumentName, formatFactory);
}
 
开发者ID:ruediste,项目名称:i18n,代码行数:26,代码来源:NumberParser.java


示例2: normalizeDouble

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
public static Number normalizeDouble( Double dValue, String pattern )
{
	Number value = null;
	if ( pattern != null && pattern.trim( ).length( ) > 0 )
	{
		NumberFormat df = new DecimalFormat( pattern );

		String sValue = df.format( dValue );

		try
		{
			value = df.parse( sValue );
		}
		catch ( ParseException e )
		{
			logger.log( e );;
		}

	}
	else
	{
		value = normalizeDouble( dValue );
	}
	return value;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:26,代码来源:ValueFormatter.java


示例3: getDecimalFormat

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
DecimalFormat getDecimalFormat()
{
	if ( this.si.fs == null ) // CREATE IF FORMAT SPECIFIER IS UNDEFINED
	{
		if ( !as.isBigNumber( ) )
		{
			this.df = as.computeDecimalFormat( dAxisValue, dAxisStep );
		}
		else
		{

			this.df = as.computeDecimalFormat( bdAxisValue.multiply( as.getBigNumberDivisor( ),
					NumberUtil.DEFAULT_MATHCONTEXT ), bdStep);
		}
	}
	return this.df;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:AutoScale.java


示例4: format

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
public String format( Object obj )
{
	String str = ""; //$NON-NLS-1$

	if ( obj != null )
	{
		if ( obj instanceof Number )
		{
			// TODO: use format cache to improve performance
			double d = ( (Number) obj ).doubleValue( );
			String sPattern = ValueFormatter.getNumericPattern( d );
			DecimalFormat df = new DecimalFormat( sPattern );
			str = df.format( d );
		}
		else
		{
			str = obj.toString( );
		}
	}

	return str;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:23,代码来源:SeriesNameFormat.java


示例5: format

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
public String format( Number number, ULocale lo )
{
	Number n = NumberUtil.transformNumber( number );
	if ( n instanceof Double )
	{
		return format( ( (Double) n ).doubleValue( ), lo );
	}

	// Format big decimal
	BigDecimal bdNum = (BigDecimal) n;
	final DecimalFormat df = (DecimalFormat) DecimalFormat.getInstance( lo );
	String vPattern = NumberUtil.adjustBigNumberFormatPattern( getPattern( ) );
	if ( vPattern.indexOf( 'E' ) < 0 )
	{
		vPattern = vPattern + NumberUtil.BIG_DECIMAL_FORMAT_SUFFIX;
	}
	df.applyPattern( vPattern );
	return isSetMultiplier( ) ? df.format( bdNum.multiply( BigDecimal.valueOf( getMultiplier( ) ),
			NumberUtil.DEFAULT_MATHCONTEXT ) )
			: df.format( bdNum );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:22,代码来源:JavaNumberFormatSpecifierImpl.java


示例6: format

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
public String format( double dValue, ULocale lo )
{
	final DecimalFormat df = (DecimalFormat) DecimalFormat.getInstance( lo );
	if ( isSetFractionDigits( ) )
	{
		df.setMinimumFractionDigits( getFractionDigits( ) );
		df.setMaximumFractionDigits( getFractionDigits( ) );
	}

	df.applyLocalizedPattern( df.toLocalizedPattern( ) );

	final StringBuffer sb = new StringBuffer( );
	if ( getPrefix( ) != null )
	{
		sb.append( getPrefix( ) );
	}
	sb.append( isSetMultiplier( ) ? df.format( dValue * getMultiplier( ) )
			: df.format( dValue ) );
	if ( getSuffix( ) != null )
	{
		sb.append( getSuffix( ) );
	}

	return sb.toString( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:26,代码来源:NumberFormatSpecifierImpl.java


示例7: createNumberFormat

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
private NumberFormat createNumberFormat() {
    ULocale locale = ULocale.forLanguageTag(this.locale);
    locale = locale.setKeywordValue("numbers", "latn");

    DecimalFormat numberFormat = (DecimalFormat) NumberFormat.getInstance(locale, NumberFormat.NUMBERSTYLE);
    if (minimumSignificantDigits != 0 && maximumSignificantDigits != 0) {
        numberFormat.setSignificantDigitsUsed(true);
        numberFormat.setMinimumSignificantDigits(minimumSignificantDigits);
        numberFormat.setMaximumSignificantDigits(maximumSignificantDigits);
    } else {
        numberFormat.setSignificantDigitsUsed(false);
        numberFormat.setMinimumIntegerDigits(minimumIntegerDigits);
        numberFormat.setMinimumFractionDigits(minimumFractionDigits);
        numberFormat.setMaximumFractionDigits(maximumFractionDigits);
    }
    // as required by ToRawPrecision/ToRawFixed
    numberFormat.setRoundingMode(BigDecimal.ROUND_HALF_UP);
    return numberFormat;
}
 
开发者ID:anba,项目名称:es6draft,代码行数:20,代码来源:PluralRulesObject.java


示例8: toFixedDecimal

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
@SuppressWarnings("deprecation")
com.ibm.icu.text.PluralRules.FixedDecimal toFixedDecimal(double n) {
    NumberFormat nf = getNumberFormat();

    StringBuffer sb = new StringBuffer();
    FieldPosition fp = new FieldPosition(DecimalFormat.FRACTION_FIELD);
    nf.format(n, sb, fp);

    int v = fp.getEndIndex() - fp.getBeginIndex();
    long f = 0;
    if (v > 0) {
        ParsePosition pp = new ParsePosition(fp.getBeginIndex());
        f = nf.parse(sb.toString(), pp).longValue();
    }
    return new com.ibm.icu.text.PluralRules.FixedDecimal(n, v, f);
}
 
开发者ID:anba,项目名称:es6draft,代码行数:17,代码来源:PluralRulesObject.java


示例9: createNumberFormat

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
private static NumberFormat createNumberFormat(final Element element) {
	Element numberFormatElement = element.getChild(XMLTags.NUMBER);
	String pattern = numberFormatElement.getChildText(XMLTags.PATTERN);
	Element localeElement = numberFormatElement.getChild(XMLTags.LOCALE);
	String language = localeElement.getChildText(XMLTags.LANGUAGE);
	String country = localeElement.getChildText(XMLTags.COUNTRY);
	ULocale locale = new ULocale(language, country);
	return new DecimalFormat(pattern, new DecimalFormatSymbols(locale));
}
 
开发者ID:mgm-tp,项目名称:jfunk,代码行数:10,代码来源:FormatFactory.java


示例10: createNumberFormat

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
private NumberFormat createNumberFormat() {
    ULocale locale = ULocale.forLanguageTag(this.locale);
    int choice;
    if ("decimal".equals(style)) {
        choice = NumberFormat.NUMBERSTYLE;
    } else if ("percent".equals(style)) {
        choice = NumberFormat.PERCENTSTYLE;
    } else {
        if ("code".equals(currencyDisplay)) {
            choice = NumberFormat.ISOCURRENCYSTYLE;
        } else if ("symbol".equals(currencyDisplay)) {
            choice = NumberFormat.CURRENCYSTYLE;
        } else {
            choice = NumberFormat.PLURALCURRENCYSTYLE;
        }
    }
    DecimalFormat numberFormat = (DecimalFormat) NumberFormat.getInstance(locale, choice);
    if ("currency".equals(style)) {
        numberFormat.setCurrency(Currency.getInstance(currency));
    }
    // numberingSystem is already handled in language-tag
    // assert locale.getKeywordValue("numbers").equals(numberingSystem);
    if (minimumSignificantDigits != 0 && maximumSignificantDigits != 0) {
        numberFormat.setSignificantDigitsUsed(true);
        numberFormat.setMinimumSignificantDigits(minimumSignificantDigits);
        numberFormat.setMaximumSignificantDigits(maximumSignificantDigits);
    } else {
        numberFormat.setSignificantDigitsUsed(false);
        numberFormat.setMinimumIntegerDigits(minimumIntegerDigits);
        numberFormat.setMinimumFractionDigits(minimumFractionDigits);
        numberFormat.setMaximumFractionDigits(maximumFractionDigits);
    }
    numberFormat.setGroupingUsed(useGrouping);
    // as required by ToRawPrecision/ToRawFixed
    // FIXME: ICU4J bug:
    // new Intl.NumberFormat("en",{useGrouping:false}).format(111111111111111)
    // returns "111111111111111.02"
    numberFormat.setRoundingMode(BigDecimal.ROUND_HALF_UP);
    return numberFormat;
}
 
开发者ID:anba,项目名称:es6draft,代码行数:41,代码来源:NumberFormatObject.java


示例11: sciToDollar

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
public static String sciToDollar(double valueToRound)
{
	double roundedValue = Math.round(valueToRound);
	DecimalFormat df = new DecimalFormat("#0");
	NumberFormat formatter = NumberFormat.getCurrencyInstance();
	df.format(roundedValue);
	String retString = formatter.format(roundedValue);
	return retString;
}
 
开发者ID:SEMOSS,项目名称:semoss,代码行数:10,代码来源:Utility.java


示例12: WebSearchResultPanel

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
public WebSearchResultPanel(String id, SolrDocument doc, final SearchResultsDataProvider dataProvider) {
	super(id, doc, dataProvider);
	
	String contentLength = (String) doc.getFieldValue("contentLength");
	String type = (String) doc.getFieldValue("subType");

	String contentLengthKBStr;
	if (StringUtils.isNotBlank(contentLength)) {
		long contentLengthBytes;
		try {
			contentLengthBytes = Long.valueOf(contentLength);
		} catch (NumberFormatException e) {
			contentLengthBytes = -1;
		}
		double contentLengthKB = (double) contentLengthBytes / 1000;
		DecimalFormat contentLengthKBFormatter = new DecimalFormat();
		contentLengthKBFormatter.setMinimumFractionDigits(0);
		contentLengthKBFormatter.setMaximumFractionDigits(0);
		contentLengthKBStr = contentLengthKBFormatter.format(contentLengthKB);
		if ("0".equals(contentLengthKBStr)) {
			contentLengthKBStr = null;
		}
	} else {
		contentLengthKBStr = null;
	}

	add(new Label("contentLength", contentLengthKBStr + " KB").setVisible(contentLengthKBStr != null));
	add(new Label("type", type).setVisible(StringUtils.isNotBlank(type)));
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:30,代码来源:WebSearchResultPanel.java


示例13: IntelliGIDSearchResultPanel

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
public IntelliGIDSearchResultPanel(String id, SolrDocument doc, final SearchResultsDataProvider dataProvider) {
	super(id, doc, dataProvider);
	
	String contentLength = (String) doc.getFieldValue("contentLength");
	String type = (String) doc.getFieldValue("subType");

	String contentLengthKBStr;
	if (StringUtils.isNotBlank(contentLength)) {
		long contentLengthBytes;
		try {
			contentLengthBytes = Long.valueOf(contentLength);
		} catch (NumberFormatException e) {
			contentLengthBytes = -1;
		}
		double contentLengthKB = (double) contentLengthBytes / 1000;
		DecimalFormat contentLengthKBFormatter = new DecimalFormat();
		contentLengthKBFormatter.setMinimumFractionDigits(0);
		contentLengthKBFormatter.setMaximumFractionDigits(0);
		contentLengthKBStr = contentLengthKBFormatter.format(contentLengthKB);
		if ("0".equals(contentLengthKBStr)) {
			contentLengthKBStr = null;
		}
	} else {
		contentLengthKBStr = null;
	}

	add(new Label("contentLength", contentLengthKBStr + " KB").setVisible(contentLengthKBStr != null));
	add(new Label("type", type).setVisible(StringUtils.isNotBlank(type)));
	
	
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:32,代码来源:IntelliGIDSearchResultPanel.java


示例14: espaSubprojects

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
public static void espaSubprojects() throws ParseException {

        //services for each table
        ApplicationContext ctx = new ClassPathXmlApplicationContext("spring.xml");
        SubProjectsService sub = (SubProjectsService) ctx.getBean("subProjectsServiceImpl");

        List<SubProjects> subProject = sub.getSubProjects();

        //--------------RDF Model--------------//
        Model model = ModelFactory.createDefaultModel();
        Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
        InfModel infModel = ModelFactory.createInfModel(reasoner, model);

        model.setNsPrefix("elod", OntologySpecification.elodPrefix);
        model.setNsPrefix("gr", OntologySpecification.goodRelationsPrefix);
        model.setNsPrefix("dcterms", OntologySpecification.dctermsPrefix);

        //number format
        DecimalFormat df = new DecimalFormat("0.00");

        for (SubProjects subProject1 : subProject) {

            Resource instanceCurrency = infModel.createResource("http://linkedeconomy.org/resource/Currency/EUR");
            Resource instanceBudgetUps = infModel.createResource(OntologySpecification.instancePrefix
                    + "UnitPriceSpecification/BudgetItem/" + subProject1.getOps() + "/" + subProject1.getId());
            Resource instanceBudget = infModel.createResource(OntologySpecification.instancePrefix + "BudgetItem/" + subProject1.getOps() + "/" + subProject1.getId());
            Resource instanceSubProject = infModel.createResource(OntologySpecification.instancePrefix + "Subproject/" + subProject1.getOps() + "/" + subProject1.getId());
            Resource instanceProject = infModel.createResource(OntologySpecification.instancePrefix
                    + "Subsidy/" + subProject1.getOps());
            DateFormat dfDate = new SimpleDateFormat("dd/MM/yyyy");
            DateFormat df2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
            java.util.Date stDateStarts;
            java.util.Date stDateEnds;
            stDateStarts = dfDate.parse(subProject1.getStart());
            stDateEnds = dfDate.parse(subProject1.getFinish());
            String startDate = df2.format(stDateStarts);
            String endDate = df2.format(stDateEnds);
            infModel.add(instanceProject, RDF.type, OntologySpecification.projectResource);
            infModel.add(instanceBudgetUps, RDF.type, OntologySpecification.priceSpecificationResource);
            infModel.add(instanceBudget, RDF.type, OntologySpecification.budgetResource);
            infModel.add(instanceSubProject, RDF.type, OntologySpecification.subProjectResource);
            instanceProject.addProperty(OntologySpecification.hasRelatedProject, instanceSubProject);
            instanceSubProject.addProperty(OntologySpecification.hasRelatedBudgetItem, instanceBudget);
            instanceBudget.addProperty(OntologySpecification.price, instanceBudgetUps);
            instanceBudgetUps.addProperty(OntologySpecification.hasCurrencyValue, df.format(subProject1.getBudget()), XSDDatatype.XSDfloat);
            instanceBudgetUps.addProperty(OntologySpecification.valueAddedTaxIncluded, "true", XSDDatatype.XSDboolean);
            instanceBudgetUps.addProperty(OntologySpecification.hasCurrency, instanceCurrency);
            instanceSubProject.addProperty(OntologySpecification.startDate, startDate, XSDDatatype.XSDdateTime);
            instanceSubProject.addProperty(OntologySpecification.endDate, endDate, XSDDatatype.XSDdateTime);
            instanceSubProject.addProperty(OntologySpecification.title, String.valueOf(subProject1.getTitle()), "el");
        }

        try {
            FileOutputStream fout = new FileOutputStream(
                    "/Users/giovaf/Documents/yds_pilot1/espa_tests/22-02-2016_ouput/subProjectEspa.rdf");
            model.write(fout);
        } catch (IOException e) {
            System.out.println("Exception caught" + e.getMessage());
        }
    }
 
开发者ID:YourDataStories,项目名称:harvesters,代码行数:61,代码来源:SubProjectsImpl.java


示例15: exportRfd

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
/**
 *
 * Implementation Of Subproject Service layer 
 * and transformation of Database data to RDF
 *
 * @throws java.text.ParseException
 * @throws java.io.UnsupportedEncodingException
 * @throws java.io.FileNotFoundException
 */

public static void exportRfd() throws ParseException, UnsupportedEncodingException, FileNotFoundException, IOException {

    //services for each table
    ApplicationContext ctx = new ClassPathXmlApplicationContext("spring.xml");
    SubProjectsService sub = (SubProjectsService) ctx.getBean("subProjectsServiceImpl");

    List<SubprojectsProjects> subProject = sub.getInfoSubproject();

    //--------------RDF Model--------------//
    Model model = ModelFactory.createDefaultModel();
    Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
    InfModel infModel = ModelFactory.createInfModel(reasoner, model);

    model.setNsPrefix("elod", OntologySpecification.elodPrefix);
    model.setNsPrefix("gr", OntologySpecification.goodRelationsPrefix);
    model.setNsPrefix("dcterms", OntologySpecification.dctermsPrefix);

    //number format
    DecimalFormat df = new DecimalFormat("0.00");
    
    for (SubprojectsProjects subProject1 : subProject) {

        Resource instanceCurrency = infModel.createResource("http://linkedeconomy.org/resource/Currency/EUR");
        Resource instanceUps = infModel.createResource(OntologySpecification.instancePrefix
                + "UnitPriceSpecification/" + subProject1.getOps() + "/" + subProject1.getSubprojectId());
        Resource instanceBudget = infModel.createResource(OntologySpecification.instancePrefix + "BudgetItem/" + subProject1.getOps() + "/" + subProject1.getSubprojectId());
        Resource instanceSubProject = infModel.createResource(OntologySpecification.instancePrefix + "Contract/" + subProject1.getOps() + "/" + subProject1.getSubprojectId());
        Resource instanceProject = infModel.createResource(OntologySpecification.instancePrefix
                + "PublicWork/" + subProject1.getOps());

        infModel.add(instanceUps, RDF.type, OntologySpecification.priceSpecificationResource);
        infModel.add(instanceBudget, RDF.type, OntologySpecification.budgetResource);
        infModel.add(instanceSubProject, RDF.type, OntologySpecification.contractResource);
        instanceProject.addProperty(OntologySpecification.hasRelatedContract, instanceSubProject);
        instanceSubProject.addProperty(OntologySpecification.price, instanceUps);
        instanceUps.addProperty(OntologySpecification.hasCurrencyValue, df.format(subProject1.getBudget()), XSDDatatype.XSDfloat);
        instanceUps.addProperty(OntologySpecification.valueAddedTaxIncluded, "true", XSDDatatype.XSDboolean);
        instanceUps.addProperty(OntologySpecification.hasCurrency, instanceCurrency);
        if (subProject1.getStart() != null) {
            instanceSubProject.addProperty(OntologySpecification.pcStartDate, subProject1.getStart().replace("/", "-"), XSDDatatype.XSDdate);
        }
        if (subProject1.getFinish() != null) {
            instanceSubProject.addProperty(OntologySpecification.actualEndDate, subProject1.getFinish().replace("/", "-"), XSDDatatype.XSDdate);
        }
        instanceSubProject.addProperty(OntologySpecification.title, String.valueOf(subProject1.getTitle()), "el");
    }

    try {
        FileOutputStream fout = new FileOutputStream(
                CommonVariables.serverPath + "subProjectEspa_"+ CommonVariables.currentDate + ".rdf");
        model.write(fout);
        fout.close();
    } catch (IOException e) {
        System.out.println("Exception caught" + e.getMessage());
    }
}
 
开发者ID:YourDataStories,项目名称:harvesters,代码行数:67,代码来源:SubProjectsImpl.java


示例16: RoundTo2Decimals

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
public static double RoundTo2Decimals(double val) 
{
       DecimalFormat df2 = new DecimalFormat("###.##");
       return Double.valueOf(df2.format(val));
}
 
开发者ID:GenDeathrow,项目名称:Skills,代码行数:6,代码来源:MathHelper.java


示例17: roundToDecimal

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
public static double roundToDecimal(double d) {
	DecimalFormat df2 = new DecimalFormat("###.##");
	return Double.valueOf(df2.format(d));
}
 
开发者ID:ItsAMysterious,项目名称:Real-Life-Mod-1.8,代码行数:5,代码来源:MathUtils.java


示例18: setAsText

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
@Override
public void setAsText(String text) {
	setValue(text == null ? null : new DecimalFormat(text));
	originalValue = text;
}
 
开发者ID:agwlvssainokuni,项目名称:sqlapp,代码行数:6,代码来源:Icu4jNumberFormatEditor.java


示例19: testFormat2

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
public void testFormat2( ) throws ChartException
{
	assertEquals( "13.1", ValueFormatter.format( new Double( 13.1 ), null, null, new DecimalFormat( ) ) );//$NON-NLS-1$ 
	assertEquals( "13.1", ValueFormatter.format( NumberDataElementImpl.create( 13.1 ), null, null, new DecimalFormat( ) ) );//$NON-NLS-1$
}
 
开发者ID:eclipse,项目名称:birt,代码行数:6,代码来源:ValueFormatterTest.java


示例20: computeDecimalFormat

import com.ibm.icu.text.DecimalFormat; //导入依赖的package包/类
public final DecimalFormat computeDecimalFormat( BigDecimal bdAxisValue, BigDecimal bdAxisStep)
{
	if ( bdAxisValue.abs( ).compareTo( UPER_LIMIT ) >= 0
			|| bdAxisStep.abs( ).compareTo( UPER_LIMIT ) >= 0 )
	{
		return info.cacheNumFormat.get( "0.0E0" ); //$NON-NLS-1$
	}
	
	// Use a more precise pattern
	String valuePattern;
	String stepPattern;

	boolean bValuePrecise = false;
	boolean bStepPrecise = false;

	// return NumberUtil.getBigDecimalFormat( );
	valuePattern = ValueFormatter.getNumericPattern( bdAxisValue );
	stepPattern = ValueFormatter.getNumericPattern( bdAxisStep );

	bValuePrecise = ChartUtil.checkBigNumberPrecise( bdAxisValue );
	bStepPrecise = ChartUtil.checkBigNumberPrecise( bdAxisStep );

	// See Bugzilla#185883
	if ( bValuePrecise )
	{
		if ( bStepPrecise )
		{
			// If they are both double-precise, use the more precise one
			if ( valuePattern.length( ) < stepPattern.length( ) )
			{
				return info.cacheNumFormat.get( stepPattern );
			}
		}
	}
	else
	{
		if ( bStepPrecise )
		{
			return info.cacheNumFormat.get( stepPattern );
		}
		// If they are neither double-precise, use the default value
	}
	return info.cacheNumFormat.get( valuePattern );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:45,代码来源:AutoScale.java



注:本文中的com.ibm.icu.text.DecimalFormat类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WrongMethodTypeException类代码示例发布时间:2022-05-21
下一篇:
Java Resolution类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap