www.webOShelp.net

Get the latest on:webOS Developers' RSS FeedwebOS Facebook page webOS Twitter Feed

Home Resources API Reference Mojo.Format.formatChoice(value, choiceString, model)

Mojo.Format.formatChoice(value, choiceString, model)

Formats a string based on the data to be displayed.

Example usage:

    var files = 2185;
var model = { num: files };
print(Mojo.Format.formatChoice(files, "0#There are no files|1#There is one file|2<#There are #{num} files.", model);

Output:

    There are 2185 files.
Parameter Type Description
value Object Value used to select a choice from the choiceString.
choiceString String Concatenation of possible string choices.
model Object Object containing value.
 

0 Comments

    Add Comment


      • >:o
      • :-[
      • :'(
      • :-(
      • :-D
      • :-*
      • :-)
      • :P
      • :\
      • 8-)
      • ;-)