congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
NSNumberFormatter
Code IndexAdd Tabnine to your IDE (free)

How to use
NSNumberFormatter
in
com.webobjects.foundation

Best Java code snippets using com.webobjects.foundation.NSNumberFormatter (Showing top 7 results out of 315)

origin: wonder.ajax/Ajax

@Override
public void takeValuesFromRequest(WORequest worequest, WOContext wocontext) {
  String format = null;
  try {
      format = (String) valueForBinding("numberformat", "0");
      Number num = worequest.numericFormValueForKey(wocontext.elementID(), new NSNumberFormatter(format));
      if(num != null) {
        setValueForBinding(num, "value");
      }
  } catch(NumberFormatException ex) {
    log.error("Could not format value with pattern '{}'.", format, ex);
  }
  super.takeValuesFromRequest(worequest, wocontext);
}
origin: wonder.ajax/Ajax

try {
  if (numberFormat != null) {
    value = ERXNumberFormatter.numberFormatterForPattern(numberFormat).format(value);
origin: wonder.core/JavaWOExtensions

} else if (className.equals("java.lang.Number") || className.equals("java.math.BigDecimal")) {
  String numberFormatterString = formatterForKey(selectedKey());
  NSNumberFormatter numberFormatter = new NSNumberFormatter(numberFormatterString);
  Object objectValue = null;
  try {
    objectValue = numberFormatter.parseObject((value != null) ? value.toString() : "");
  } catch (ParseException e) {
    if (NSLog.debugLoggingAllowedForLevelAndGroups(NSLog.DebugLevelDetailed, NSLog.DebugGroupWebObjects)) {
origin: wonder.core/JavaWOExtensions

public String textFieldValue() {
  if (_textFieldValue != null) {
    return _textFieldValue;
  }
  Object value = value();
  setValue(value);
  if (value == null) {
    return null;
  } else if (value instanceof String) {
    return (String) value;
  } else {
    java.text.Format formatter = null;
    String className = valueClassNameForKey(selectedKey());
    if (className.equals("com.webobjects.foundation.NSTimestamp")) {
      String dateFormatterString = formatterForKey(selectedKey());
      formatter = new NSTimestampFormatter(dateFormatterString);
    } else if (className.equals("java.lang.Number") || className.equals("java.math.BigDecimal")) {
      String numberFormatterString = formatterForKey(selectedKey());
      formatter = new NSNumberFormatter(numberFormatterString);
    }
    return (formatter != null) ? formatter.format(value) : value.toString();
  }
}
origin: wonder.reporting/WRReporting

public String singleTotal() {
  if(recordGroup() == null)
    return noTotalLabel();
  String totalKey = totalToShow();
  double doubleValue = 0.0;
  
  if(totalKey != null) {
    NSArray tots = recordGroup().totalList();
    
    if (tots != null && tots.count() > 0) {
      DRValue v = recordGroup().totalForKey(totalToShow());
      if(v != null) {
        doubleValue = v.total();
      } else {
        return noTotalLabel();
      }
    }
  }
  Number nm = Double.valueOf(doubleValue);
  String formatString = (String)valueForBinding("formatForSingleTotal");
  NSNumberFormatter formatter = ERXNumberFormatter.numberFormatterForPattern(formatString);
  return formatter.format(nm);
}
origin: wonder.eof/ERIndexing

/**
 * This class corresponds to one property. indexModel --> properties --> a property
 * 
 * @param index the index
 * @param name the property name (a key or keypath)
 * @param dict the property definition form indexModel
 */
IndexAttribute(ERIndex index, String name, NSDictionary dict) {
  _name = name;
  _termVector = (TermVector) classValue(dict, "termVector", TermVector.class, "YES");
  _store = (Store) classValue(dict, "store", Store.class, "NO");
  _index = (Index) classValue(dict, "index", Index.class, "ANALYZED");
  String analyzerClass = (String) dict.objectForKey("analyzer");
  if (analyzerClass == null) {
    analyzerClass = StandardAnalyzer.class.getName();
  }
  _analyzer = (Analyzer) create(analyzerClass);
  if (_analyzer == null && name.matches("\\w+_(\\w+)")) {
    // String locale = name.substring(name.lastIndexOf('_') + 1);
  }
  _format = (Format) create((String) dict.objectForKey("format"));
  String numberFormat = (String) dict.objectForKey("numberformat");
  if (numberFormat != null) {
    _format = new NSNumberFormatter(numberFormat);
  }
  String dateformat = (String) dict.objectForKey("dateformat");
  if (dateformat != null) {
    _format = new NSTimestampFormatter(dateformat);
  }
}
origin: wonder.core/JavaWOExtensions

line = request.numericFormValueForKey("line",new NSNumberFormatter("#0"));
filename = request.stringFormValueForKey("filename");
errorMessage = request.stringFormValueForKey("errorMessage");
com.webobjects.foundationNSNumberFormatter

Most used methods

  • <init>
  • format
  • parseObject

Popular in Java

  • Running tasks concurrently on multiple threads
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • findViewById (Activity)
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • IsNull (org.hamcrest.core)
    Is the value null?
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now