Thank you for supporting the Cloud Customer Connect Community in 2024. It's a gift to work with you!

Look back
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Add $ to only non zero values in number column in oj-table

edited Jul 27, 2021 7:03AM in Visual Builder 4 comments

Summary

Add $ to only non zero values in number column in oj-table

Content

Hi All,

I have used below template for one column in the table,

<template slot="price">
<oj-input-number value='[[typeof $current.data === "number" ? $current.data : null]]' readonly="true"
      style="text-align: right; width:20px;"
      converter='{"options":{"style":"currency","currency":"USD","currencyFormat":"standard","minimumFractionDigits":2,"maximumFractionDigits":2},"type":"number"}'>
</oj-input-number>
</template>
 
With the above template I am able to add $ symbol in front of all the values in the whole column.
 
I am looking for for any option in which the $ symbol is only be prefixed if value is greater than 0

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!