mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-12-05 05:17:47 +08:00
37 lines
677 B
C++
37 lines
677 B
C++
/*
|
||
* ROUNDUP.h
|
||
*
|
||
* Copyright (c) 2019 hikyuu.org
|
||
*
|
||
* Created on: 2019-4-14
|
||
* Author: fasiondog
|
||
*/
|
||
|
||
#pragma once
|
||
#ifndef INDICATOR_CRT_ROUNDUP_H_
|
||
#define INDICATOR_CRT_ROUNDUP_H_
|
||
|
||
#include "CVAL.h"
|
||
|
||
namespace hku {
|
||
|
||
/**
|
||
* 向上截取,如10.1截取后为11
|
||
* @ingroup Indicator
|
||
*/
|
||
Indicator HKU_API ROUNDUP(int ndigits = 2);
|
||
Indicator ROUNDUP(price_t, int ndigits = 2);
|
||
Indicator ROUNDUP(const Indicator& ind, int ndigits = 2);
|
||
|
||
inline Indicator ROUNDUP(const Indicator& ind, int n) {
|
||
return ROUNDUP(n)(ind);
|
||
}
|
||
|
||
inline Indicator ROUNDUP(price_t val, int n) {
|
||
return ROUNDUP(CVAL(val), n);
|
||
}
|
||
|
||
} // namespace hku
|
||
|
||
#endif /* INDICATOR_CRT_ROUNDUP_H_ */
|