bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

The correct way to print hex number as dec number?


From: Peng Yu
Subject: The correct way to print hex number as dec number?
Date: Fri, 13 Mar 2020 11:30:21 -0500

Hi,

I see that --non-decimal-data must be used to print hex number as a
dec number. Is it the correct way to do so? I'd like to control this a
finer scale. Is there a way to dictate which column this option is
effective? Thanks.

$ awk --non-decimal-data '{ printf("%d\n", $1) }' <<< '0xaaaa'
43690
$ awk '{ printf("%d\n", $1) }' <<< '0xaaaa'
0

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]