简体   繁体   中英

idl float to string conversion

Hello I am trying to convert float to string in IDL/cpp. I am assuming that is what I need to do as that is what the error indicated when I tried to compile. What I am trying to do is grab the "value" of minDamage and maxDamage.

@dirty
public native float getMaxDamage(boolean withPup = true);

public void setMaxDamage(float value) {
    maxDamage = value;
}

@dirty
public native float getMinDamage(boolean withPup = true);

public void setMinDamage(float value) {
    minDamage = value;
}

But when I try to do so I get the error

 error: could not convert from ‘float’ to ‘sys::lang::String’
  return maxDamage;
         ^~~~~~~~~

Thanks for any help, if there is any more information needed just let me know.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM