nova-money-field
nova-money-field copied to clipboard
Red for negative and Green for positive values
Hi,
This would be very nice addon.
In Money.php it could be something like this:
$formattedValue = $this->inMinorUnits ? $value / $this->minorUnit($currency) : (float) $value;
if($value < 0)
{
$formattedValue = '<span style="color:red">' . $value . '</span>';
}
else
{
$formattedValue = '<span style="color:green">' . $value . '</span>';
}
return $formattedValue;
and then in IndexField.vue and detailField.vue we should allow value in html format
v-html="formattedValue">
hi @eAvio - this seems like a reasonable idea, Questions
- would this affect only detail/display or would this also apply edit screens
- would this be configurable as to the colours?
- i'm guessing in detail/display this would be the text colour..