Name

sub()

Class

FloatDict

Description

Subtract from a value.

Examples

  • FloatDict inventory;
    
    void setup() {
      size(200, 200);
      inventory = new FloatDict();
      inventory.set("coffee",108.6);
      inventory.set("flour",5.8);
      inventory.set("tea",8.2);
      println(inventory);  // There is 5.8 of flour
      inventory.sub("flour", 3.4);
      println(inventory);  // There is 2.4 of flour
    }
    
    

Syntax

  • .sub(key, amount)

Return

  • void