Calculating a hex value of a decimal config value

I currently have this

        - name: network_chainid
          title: Network ID
          type: text
          default: '555'
          help_text: |
            Decimal chain id
          required: true
          when: repl{{ ConfigOptionNotEquals "blockchain_client" "blockchain_client_fabric" }}

        - name: network_net_version
          title: Network Version ID
          type: text
          default: '0x1365'
          help_text: |
            Hexadecimal chain id -> https://www.rapidtables.com/convert/number/hex-to-decimal.html
          required: true
          when: repl{{ ConfigOptionNotEquals "blockchain_client" "blockchain_client_fabric" }}

but I would like to remove the second one as it is a calculated value. but I can’t find a way to do so in sprig, config, manifest or helm chart

Any idea’s?

Haven’t tested this but could you use go templates’ printf with the %0x syntax? Looks like golang supports this, so something like

{{repl printf "%x" (ConfigOption "something")}}

That works, for reference {{repl printf "%#x" (int (ConfigOption "network_chainid")) }}