mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-12-05 05:17:47 +08:00
36 lines
617 B
C++
36 lines
617 B
C++
/*
|
|
* ROUND.h
|
|
*
|
|
* Copyright (c) 2019 hikyuu.org
|
|
*
|
|
* Created on: 2019-4-14
|
|
* Author: fasiondog
|
|
*/
|
|
|
|
#ifndef INDICATOR_CRT_ROUND_H_
|
|
#define INDICATOR_CRT_ROUND_H_
|
|
|
|
#include "CVAL.h"
|
|
|
|
namespace hku {
|
|
|
|
/**
|
|
* 四舍五入
|
|
* @ingroup Indicator
|
|
*/
|
|
Indicator HKU_API ROUND(int ndigits = 2);
|
|
Indicator ROUND(price_t, int ndigits = 2);
|
|
Indicator ROUND(const Indicator& ind, int ndigits = 2);
|
|
|
|
inline Indicator ROUND(const Indicator& ind, int n) {
|
|
return ROUND(n)(ind);
|
|
}
|
|
|
|
inline Indicator ROUND(price_t val, int n) {
|
|
return ROUND(CVAL(val), n);
|
|
}
|
|
|
|
} /* namespace */
|
|
|
|
#endif /* INDICATOR_CRT_ROUND_H_ */
|