Fetch the float-value of a kb attribute attrName belonging to concept concept. If there are multiple numeric values, only the first value is returned.
returnedNum = fltval(concept, attrName);
returnedNum - type: float
concept - type: con
attrName - type: str
A floating point number, returnedNum.
Concepts can have zero or more attributes. Each attribute can have zero or more values. This function takes a concept and attribute name as input arguments and returns the first value associated with the attribute name, which must be a float.
@CODE
L("pi") = makeconcept(findroot(), "pi");
replaceval(L("pi"),"val",3.14);
"output.txt" << "pi = " << fltval(L("pi"), "val") << "\n";
Prints out the following to output.txt:
pi = 3.14
numval, Knowledge Base Functions