Reputation: 37
This is my code. I want to store this total value into database
How can I do that? If I directly assign to double variable it shows error:
double binding value cannot converted into double
DoubleBinding total = Bindings.createDoubleBinding(() ->
supplytable.getItems().stream().collect(Collectors.summingDouble(conductor::getPrice)),
supplytable.getItems());
lbltotal.textProperty().bind(Bindings.format("Total: %.2f", total));
Upvotes: 1
Views: 1289
Reputation: 21809
You can use for example getValue()
or doubleValue()
method of DoubleBinding
:
double doubleValue = total.doubleValue();
Double value = total.getValue();
Upvotes: 1