zoukankan      html  css  js  c++  java
  • x++实现物料数量的单位换算

     qty getUnitConvert(Qty          qty,
                       ItemId       ItemId,
                       UnitId       _InventUnit,
                       UnitId       _CsmUnitId)
    {
        Real       factor_ok;
        Qty        CSMQty;
        ;

        factor_ok     = unitconvert::find(ItemId,_InventUnit,_CsmUnitId).Factor; //库存单位到海关单位
        if(factor_ok == 0.00)
        {
            factor_ok   = unitconvert::find(ItemId,_CsmUnitId,_InventUnit).Factor;//海关单位到库存单位
            if(factor_ok != 0.00 )

                factor_ok = 1/factor_ok;
            else

                factor_ok = 0.00;
        }//End else
        if(factor_ok == 0.00)
            CSMQty = (1/1) * qty;//海关单位的在仓数量
        else
            CSMQty = (1/factor_ok) * qty;

        return CSMQty;
    }

  • 相关阅读:
    HDU
    Groundhog Build Home
    The Moving Points
    Problem I. Count
    Problem E. TeaTree
    树的启发式合并
    Special Segments of Permutation
    网络流24题
    2015-2016 Northwestern European Regional Contest (NWERC 2015)
    The 2018 ACM-ICPC Asia Beijing Regional Contest
  • 原文地址:https://www.cnblogs.com/Fandyx/p/2761529.html
Copyright © 2011-2022 走看看