KDKVOLUMEBASENUMERICALCONVERT(3)

NAME
kdkVolumeBaseNumericalConvert - 数字格式单位进制转换

SYNOPSIS
br

#include <kyutils.h>

  Functions

  int kdkVolumeBaseNumericalConvert (double origin_numerical, KDKVolumeBaseType origin_base, KDKVolumeBaseType result_base, double * result_numerical)

数字格式单位进制转换

Parameters
    origin_numerical 原始数字类型数据
    origin_base 原始的进制单位
    result_base 期望的进制单位
    result_numerical 期望进制下的数字类型数据

Returns
    int

Link with -lkyutils.

Detailed Description
接口的主要功能是数字格式单位进制转换

EXAMPLES
    #include "kyutils.h"
    #include <stdio.h>
    #include <string.h>
    int main()
    {
        int ret = 0;
        // 调用字符型数据单位转换接口
        char  origin_data [20] = "10000.24MB";
        char result_data [50] = {0};
        ret = kdkVolumeBaseCharacterConvert(origin_data, KDK_GIGABYTE, result_data);
        printf("%s, result_data);
        // 调用数字型数据单位转换接口
        // 此例亦可说明，在低进制不足以向高进制转换时，进制保持不变
        double origin_numberical = 100.24;
        double result_numberical;
        ret = kdkVolumeBaseNumericalConvert(origin_numberical, KDK_MEGABYTE, KDK_GIGABYTE, &result_numberical);
        printf("%.2f, result_numberical);
        return 0;
    }

CONFORMING TO
These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: kdkVolumeBaseCharacterConvert().

SEE ALSO
kdkVolumeBaseCharacterConvert(3).

Author

Generated automatically by Doxygen for kyutils.h from the source code.