For compatability purposes with other forms, I have a text field that numeric data is entered into. I would however like to perform a calculation off of this field, so would therefore like to convert the number entered into this field into a numeric value rather than a text value. Can anyone explain to me how this is done?
Depending on the type of number you want you would use parseInt or parseFloat in Javascript. So when addressing your field in the calculation (assuming it is called TextField1)
var myResult = parseFloat(TextField1.rawValue) + 123.45
Depending on the type of number you want you would use parseInt or parseFloat in Javascript. So when addressing your field in the calculation (assuming it is called TextField1)
var myResult = parseFloat(TextField1.rawValue) + 123.45
The following has evaluated to null or missing:
==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41]
----
Tip: It's the step after the last dot that caused this error, not those before it.
----
Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5]
----