File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ public function defaultValue()
3131 * Pre-process the data before it gets sent to the publish page.
3232 *
3333 * @param mixed $data
34- * @return array|mixed
34+ * @return string|null
3535 */
36- public function preProcess ($ data )
36+ public function preProcess ($ data ): ? string
3737 {
3838 if ($ data === null ) {
3939 return null ;
@@ -46,6 +46,22 @@ public function preProcess($data)
4646 return trim (str_replace ($ symbol , '' , $ formatted ));
4747 }
4848
49+ /**
50+ * Pre-process the data before it gets sent to the publish page.
51+ *
52+ * @param $data
53+ * @return string|null
54+ */
55+ public function preProcessIndex ($ data ): ?string
56+ {
57+ if ($ data === null ) {
58+ return null ;
59+ }
60+
61+ $ fmt = App::make (NumberFormatter::class, ['iso ' => $ this ->getIso ()]);
62+ return $ fmt ->formatCurrency ($ data , $ this ->getIso ());
63+ }
64+
4965 /**
5066 * Process the data before it gets saved.
5167 *
You can’t perform that action at this time.
0 commit comments