1
function zh_get_invoice_round_off_number() 
    {
        global $post;
        return get_post_meta($post->ID, 'invoice_round_off_number', true);
    }

    function zh_invoice_round_off_number() 
    {
        echo zh_get_invoice_round_off_number();
    }
  • Please explain your problem. This is not a good question. See How to Ask – fuxia Jul 26 '13 at 9:51
  • @toscho he edited the question wrongly , i got his question. user2506619 When editing the question dont remove previous content and explanations. – Tolea Bivol Jul 26 '13 at 10:36
1

In the loop :

$custom_fields = get_post_custom(the_ID());
$my_custom_field = $custom_fields['zh_invoice_round_off_number'];
convert_number((int)$my_custom_field);

Or with your function :

$custom_value = zh_get_invoice_round_off_number();
echo convert_number( (int) $custom_value );
  • it is not working @Tolea Bivol – user2506619 Jul 26 '13 at 8:27
  • Do you get the custom field value at all ? If yes then : The value doesn't get converted in words ? – Tolea Bivol Jul 26 '13 at 8:33
  • yes the value doesn't get converted in words .@Tolea Bivol – user2506619 Jul 26 '13 at 8:34
  • if i do echo convert_number('zh_invoice_round_off_number();'); the value get echo but doest convert in word. @Tolea Bivol – user2506619 Jul 26 '13 at 8:42
  • You can't call a function in an another function. First place the result in a variable then pass it as a parameter : $custom_value = zh_invoice_round_off_number(); echo convert_number($custom_value); – Tolea Bivol Jul 26 '13 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.