All Downloads are FREE. Search and download functionalities are using the official Maven repository.

br.com.objectos.way.io.NumericTableFormat Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2013 Objectos, Fábrica de Software LTDA.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package br.com.objectos.way.io;

import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Workbook;

/**
 * @author [email protected] (Marcio Endo)
 */
public enum NumericTableFormat implements TableFormat {

  DECIMAL("0.00"),
  INTEGER("0"),
  PERCENTAGE_INT("0%"),
  PERCENTAGE("0.00%"),
  N03("#,##0"),
  N04("#,##0.00"),
  N05("$#,##0_);($#,##0)"),
  N06("$#,##0_);[Red]($#,##0)"),
  N07("$#,##0.00);($#,##0.00)"),
  N08("$#,##0.00_);[Red]($#,##0.00)"),
  N11("0.00E+00"),
  N12("#,##0_);(#,##0)"),
  N13("#,##0_);[Red](#,##0)"),
  N14("#,##0.00_);(#,##0.00)"),
  N15("#,##0.00_);[Red](#,##0.00)");

  final String apachePOI;

  private NumericTableFormat(String apachePOI) {
    this.apachePOI = apachePOI;
  }

  @Override
  public void apachePOI(Workbook wb, CellStyle style) {
    WayIO.applyFormatTo(wb, style, apachePOI);
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy