use new number type to be compatible with dynamo
This commit is contained in:
@@ -796,21 +796,17 @@ execute_update_plan :: proc(item: ^Item, plan: ^Update_Plan) -> bool {
|
||||
// ============================================================================
|
||||
|
||||
numeric_add :: proc(a: Attribute_Value, b: Attribute_Value) -> (Attribute_Value, bool) {
|
||||
a_num, a_ok := a.(Number)
|
||||
b_num, b_ok := b.(Number)
|
||||
a_num, a_ok := a.(DDB_Number)
|
||||
b_num, b_ok := b.(DDB_Number)
|
||||
if !a_ok || !b_ok {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
a_val, a_parse := strconv.parse_f64(string(a_num))
|
||||
b_val, b_parse := strconv.parse_f64(string(b_num))
|
||||
if !a_parse || !b_parse {
|
||||
result, result_ok := add_ddb_numbers(a_num, b_num)
|
||||
if !result_ok {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
result := a_val + b_val
|
||||
result_str := format_number(result)
|
||||
return Number(result_str), true
|
||||
return result, true
|
||||
}
|
||||
|
||||
numeric_subtract :: proc(a: Attribute_Value, b: Attribute_Value) -> (Attribute_Value, bool) {
|
||||
|
||||
Reference in New Issue
Block a user