Skip to content

dectobcd_gcb

Anobium edited this page Oct 18, 2020 · 1 revision

DecToBcd_GCB

Syntax:

 DectoBcd( ByteVariable )

Command Availability:

Available on all microcontrollers.

Explanation:

Converts numbers from Decimal to Binary Coded Decimal format. Support Bytes only.

You can add this function. Just add this to your Great Cow BASIC program and then call it when you need it.

Example:

    Function DecToBcd(va) as Byte
       DecToBcd=(va/10)*16+va%10
    End Function

Also see BcdToDec_GCB

Clone this wiki locally